php multi condition if else ternary operator code example
Example 1: ternary operator for three conditions in php
$foo = your_value;
$bar = ($foo == 1) ? "1" : (($foo == 2) ? "2" : "other");
echo $bar;
Example 2: php multi condition if
if($var == "abc" || $var == "def" || ...)
{
echo "true";
}