What is the best way to display a table if an array is not null in PHP?
<p>If the array is not null (and has values in it), then I want to display the table.<br />
But if it is null, then I don't want to display any table code at all.</p>

<p>Using an MVC framework which appends a footer to the page.</p>

<p>What is the best way to avoid a statement like:</p>

<pre><code>&lt;?php 
  if ($users) {
    echo '&lt;table id="tha_table" cellpadding="0" cellspacing="0" width="100%"&gt;
            &lt;thead&gt;
              &lt;tr&gt;
                &lt;th&gt;First Name&lt;/th&gt;
                &lt;th&gt;Last Name&lt;/th&gt;
                &lt;th&gt;Email&lt;/th&gt;
             &lt;/tr&gt;
          &lt;/thead&gt;
         &lt;tbody&gt;';
  } ?&gt;
</code></pre>

<p>And, don't want to do another test to add the table footer.</p>
