😅😎 how to use multiple ternary operator in php, ?:, ?? (ok)

https://stackoverflow.com/questions/6203026/how-to-concatenate-multiple-ternary-operator-in-php

<?php
$foo = 2;
$bar = ($foo == 1) ? "1" : (($foo == 2)  ? "2" : "other");
echo $bar;
?>

Last updated