ternary statement not testing value as expected
<p>How could I turn this if-statement into a ternary statement?</p>

<pre><code>if ( !empty($vendor_address_row['address2'])){
    $address_obj['address2'] = $vendor_address_row['address2'];
    }else{
    $address_obj['address2'] = '&lt;tr&gt;&lt;td colspan="1"&gt;'.$address_row['address2'].'&lt;/td&gt;&lt;/tr&gt;';    
    }
</code></pre>

<p>I have trie</p>

<p><code>$vendor_address_row['address2'] ? $address_obj['address2'] = '&lt;tr&gt;&lt;td colspan="1"&gt;'.$address_row['address2'].'&lt;/td&gt;&lt;/tr&gt;' : $address_obj['address2'] = '';</code></p>

<p>and</p>

<p><code>!empty($vendor_address_row['address2']) ? $address_obj['address2'] = '&lt;tr&gt;&lt;td colspan="1"&gt;'.$address_row['address2'].'&lt;/td&gt;&lt;/tr&gt;' : $address_obj['address2'] = '';</code></p>

<p>Neither work. And there is probably a shorter way to do it besides. Thank you very much.</p>
