The trinary operator : Conditional Operator « Operator « PHP






The trinary operator

<?
$first_num =2;
$second_num = 1;

$max_num = $first_num > $second_num ? $first_num : $second_num;

echo($max_num);

?>

           
       








Related examples in the same category

1.Conditional Operator
2.Conditional Statements
3.Less-than and greater-than