how to use ternary function to if variable is not empty in php code example
Example 1: php ternary
$result = $condition ? 'foo' : 'bar';
Example 2: php ternary shorthand
$y = $x ? "true" : "false";
$result = $condition ? 'foo' : 'bar';
$y = $x ? "true" : "false";