ternärer Operator für drei Bedingungen in PHP
$foo = your_value;
$bar = ($foo == 1) ? "1" : (($foo == 2) ? "2" : "other");
echo $bar;
Ankur
$foo = your_value;
$bar = ($foo == 1) ? "1" : (($foo == 2) ? "2" : "other");
echo $bar;
$number=100;
$number=(100==$number)?"hundred":((101)?"not hundred":"not");
echo $number;