Find last value of array in foreach cicle
<p>I've data stored in a array ($rows).
For read the array and genarate a dinamic table I use foreach function.</p>

<pre><code>&lt;table&gt;

    foreach ($rows as $row) {
        echo "&lt;tr&gt;";
        echo "&lt;td&gt;" . $row['field1'] . "&lt;/td&gt;";
        echo "&lt;td&gt;" . $row['field2'] . "&lt;/td&gt;";
        echo "&lt;td&gt;" . $row['filed3'] . "&lt;/td&gt;";
        echo "&lt;/tr&gt;"; 
    }

&lt;/table&gt;
</code></pre>

<p>My goal is to find the last value of the array (the end) in order to change the class of TR element for the last line displayed.
How could I do this?
Thanks</p>
