Last loop in CodeIgniter foreach
<p>I'm trying to catch the last loop in my CodeIgniter for-loop. I'm trying to generate a &lt; hr /> under every news item but the last one. This is my code:</p>

<pre><code>&lt;table class="news"&gt;
&lt;?php foreach($news as $news_item): ?&gt;
    &lt;tr&gt;
        &lt;td class="headline"&gt;&lt;?php echo $news_item['title']; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="text"&gt;&lt;?php echo $news_item['text']; ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;hr /&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;?php endforeach; ?&gt;
&lt;/table&gt;
</code></pre>
