Is it possible to use echo with ||so that it uses the first variable that evaluates to true?
||
eg,
$a = false; $b = 'b'; echo $a || $b || 'neither'; // evaluates to 1 ?
Ternary operator
echo (($a) ? : $b) ? : 'neither';
Ultimate triple
$a = false; $b = 'b'; echo ($a)?$a:(($b)?$b:'neither');
echo $a ? $a : ($b ? $b : ($c ? $c : 'neither'));
And you continue if you have more variables, but will be too ugly and hard to read if too long.