Posted By

resting on 10/15/10


Tagged

example Ternary


Versions (?)

PHP Ternary


 / Published in: PHP
 

Just a ternary example.

Note the parentheses.

  1. $output = '<span class="b ' . ($pax == 1)?'u':'' . '">This will not work</span>';
  2.  
  3. $output = '<span class="b ' . (($pax == 1)?'u':'') . '">This will work</span>'

Report this snippet  

You need to login to post a comment.