The PHP Ternary Operator

PHP Ternary Operator :-

It is called the ternary operator because it takes three operands - a condition, a result for true, and a result for false.


Example :- 
     
<?php  
   $agestr = ($age < 16) ? 'child' : 'adult';
?> 


Comments