short ternary operator php code example
Example 1: php ternary operator
(Condition) ? (Statement1) : (Statement2);
Example 2: php ternary
$result = $condition ? 'foo' : 'bar';
(Condition) ? (Statement1) : (Statement2);
$result = $condition ? 'foo' : 'bar';