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
It's the Ternary operator a.k.a Elvis operator (google it :P) you are looking for.
echo $address['street2'] ?: 'Empty';
It returns the value of the variable or default if the variable is empty.