I've tried using the examples from this page, but I can't output any results.
This is my IF statement that works:
if (!empty($address['street2'])) echo $address['street2'].'<br />';
And this is my none-working shorthand code
$test = (empty($address['street2'])) ? 'Yes <br />' : 'No <br />';
// Also tested this
(empty($address['street2'])) ? 'Yes <br />' : 'No <br />';
What am I doing wrong?
UPDATE
After Brians tip, I discovered what went wrong.
Echoing $test outputs the result. So then I tried the following:
echo (empty($storeData['street2'])) ? 'Yes <br />' : 'No <br />';
And that worked like a charm!