PHP 7+
The code in the question only makes sense if $address['street2'] doesn't exist. Otherwise one can write just echo $address['street2']; right away, without any conditions. Quite obviously, it will output either some address or nothing.
Therefore, one doesn't need empty() here, but only isset(). So correct expression would be
if (isset($address['street2'])) echo $address['street2'];
And for this expression, starting from PHP 7, there is a shorthand, called Null coalescing operator, which can be used like this :
echo $address['street2'] ?? '';
Which will output nothing (an empty string) if $address['street2'] doesn't exist, or output this variable's contents, which will be either some address or nothing.
Only when something specific has to be output in case the variable is empty, a ternary can be used:
echo !empty($address['street2']) ? $address['street2'] : 'Empty';