ThinkPHP5中for循环使用方法及获取数组长度
2023-03-29 23:03:03
96
{{single.collect_count}}

for循环格式

for($i=0;$i<count($arr);$i++){echo $arr[$i];}

返回数组长度

$count = count($arr)

前端获取数组长度

{$arr|count}
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}