The PHP Ternary Operator

This is a great way to shorten simple if/else statements in PHP It is possible to use the Ternary Operator syntax to shorten this down to 1 line: Now, this is no doubt fairly common in your applications – a simple comparison determining the value of a variable. This can feasibly be rewritten for one…