CodeIgniterのforループの最後のループをキャッチしようとしています。最後のニュース項目を除くすべてのニュース項目の下に<hr/>を生成しようとしています。これは私のコードです:
<table class="news">
<?php foreach($news as $news_item): ?>
<tr>
<td class="headline"><?php echo $news_item['title']; ?></td>
</tr>
<tr>
<td class="text"><?php echo $news_item['text']; ?></td>
</tr>
<tr>
<td><hr /></td>
</tr>
<?php endforeach; ?>
</table>