ホームページ >バックエンド開発 >PHPチュートリアル >PHPのforeachループでif判定を行う
<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 )
= "zhuye" item = "zhuye_item" key = "zhuye_key"&gt; 、、、、、、、、、ユーザー: {$zhuye_item.note5uuidAnonym } 35e89956b2f910e380a75dca265e8bc2 コメント: {$zhuye_item.content}81e158ec091e6e6e4ad2eb67327f19fd0a596f14bdaf8472bd7e298b00adfbcf 評価: {$zhuye_item.content}81e158ec091e6e6e4ad2eb67327f19fd16b28748ea4df4d9c2150843fecfba68
ループ内のアバターの判定は失敗しました🎜 🎜 それを解決し、返された配列に配列の長さを直接追加すると、ページが取得されました。価値があるときにそれを実行するだけです。 🎜