Changes in PHP Ternary Operator since PHP 5.3
Changes in PHP ternary operator since PHP 5.3
Till PHP 5.2
$varName = ($cond) ? $cond : ‘false’;
From PHP 5.3
$varName = ($cond) ? : ‘false’;
No need to write condition for true. It will automatically taken $cond in true.
Reference URL :- http://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary
(Visited 36 times, 2 visits today)