php中foreach循环里面做if判断

奔波在生活路上 奔波在生活路上 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

<if condition='mb_strlen(zhuye_item.note5uuidHeadIdx) gt 10'>{$zhuye_item.smallUrl}<else/>{$zhuye_item.note5uuidHeadIdx}</if>
[0] => Array
(
[noteId] => 389
[deleteFlag] => 0
[note5uuid] => 300000186
[note5uuidAnonym] =>
[note5uuidHeadIdx] => [{"bigKey":"","smallUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBfCUHwTAAA_pWNnYXw019.png","smallKey":"","bigUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBeBcOe4AAGAT87yCLw740.png"}]
[note2uuid] => 300000186
[note2uuidHeadIdx] => [{"bigKey":"","smallUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBfCUHwTAAA_pWNnYXw019.png","smallKey":"","bigUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBeBcOe4AAGAT87yCLw740.png"}]
[note2uuidAnonym] =>
[sendTime] => 1448508925
[type] => 0
[content] => 涂抹急急急急急急了踏踏实实试图投资
[replyCnt] => 1
[praiseCnt] => 0
[praiseAble] => 1
[bigKey] =>
[bigUrl] => http://xxx/M00/02/1A/wKgBeVZVpBeBcOe4AAGAT87yCLw740.png
[smallKey] =>
[smallUrl] => http://xxx/1A/wKgBeVZVpBfCUHwTAAA_pWNnYXw019.png
)

[1] => Array
(
[noteId] => 366
[deleteFlag] => 0
[note5uuid] => 0
[note5uuidAnonym] => 春野樱
[note5uuidHeadIdx] => 91
[note2uuid] => 300000186
[note2uuidHeadIdx] => [{"bigKey":"","smallUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBfCUHwTAAA_pWNnYXw019.png","smallKey":"","bigUrl":"http://xxx/M00\/02\/1A\/wKgBeVZVpBeBcOe4AAGAT87yCLw740.png"}]
[note2uuidAnonym] =>
[sendTime] => 1448505049
[type] => 1
[content] => 0
[replyCnt] => 5
[praiseCnt] => 0
[praiseAble] => 1
)

大概就是两种数组,一种是JSON串,一种就是纯数字的。问题是现在页面foreach循环的时候判断这个长度没有用呢。
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
奔波在生活路上
基础编程 21,889 成员 140,329 内容