我试图捕获CodeIgniter for循环中的最后一个循环。我试图在每个新闻项目下产生一个< hr />,但最后一项。这是我的代码:CodeIgniter中的最后一个循环foreach
<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>
这是你的问题吗?是不是工作或其他.. –