您好,欢迎访问一九零五行业门户网

php中foreach循环里面做if判断

{$zhuye_item.smallurl}{$zhuye_item.note5uuidheadidx} [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循环的时候判断这个长度没有用呢。
回复讨论(解决方案) 判断里面是
头像:
            {$zhuye_item.smallurl}{$zhuye_item.note5uuidheadidx}  
            用户: {$zhuye_item.note5uuidanonym}  评论: {$zhuye_item.content} 打分:{$zhuye_item.content}
循环里头像这块判断不成功
解决了,直接在返回的数组里面加了一个数组长度,页面取值的时候eq一下就好了。
其它类似信息

推荐信息