1 2 3 4 5 6 7 8 9 10 11 12 13
<?php function myprint($val, $opt = null) { if ($opt != null) { echo $val . " " . $opt; } } $test = true; myprint("blah", ($test ? "yes" : null)); ?>
1
blah yes