Based on the examples from this page, I have the working and non-working code samples below.
Working code using if statement:
if
if (!empty
As of PHP 7, this task can be performed simply by using the Null coalescing operator like this :
echo !empty($address['street2']) ?? 'Empty';