The PHP ternary operator is a shorthand way of writing an if/else statement.
The logic of the Ternary Operator is
// basic ternary logic $result = (condition) ? return if true : return if false ;
A working example would be something like
// working example of ternary operator $due = 9; $timenow = 10 $late = ($due < $timenow) ? true : false ;
Written in long hand
// working example of ternary operator $due = 9; $timenow = 10 if ($due < $timenow) : $late = true; else: $late = false; endif;
For more info on php comparison operators and in particular the ternary operator see the php manual