分隔记录 PHP
如果我有一个检索记录的 while 循环,我希望能够通过在循环进行时将记录包装在一定数量的记录之后来分隔记录,例如
(使用 while 循环):
Record 1
Record 2
Record 3
Record 4
Record 5
Record 6
Record 7
但我需要像这样对记录进行分组:
<div class="wrap">
Record 1
Record 2
Record 3
</div>
<div class="wrap">
Record 4
Record 5
Record 6
</div>
Record 7
所以当它超过 3 时,它应该每 3 个计数换行。
If I have a while loop that retrieve records, I want to be able to delimit records by wrapping them after an amount of records while the loop is going, e.g.
(using a while loop):
Record 1
Record 2
Record 3
Record 4
Record 5
Record 6
Record 7
But I need to group records like this:
<div class="wrap">
Record 1
Record 2
Record 3
</div>
<div class="wrap">
Record 4
Record 5
Record 6
</div>
Record 7
So when it exceeds more than 3 it should wrap every 3 count.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)