PHP Ternary Operators

$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true

0 Comments

You must be logged in to post a comment.