smarty 循环

WBOY
Release: 2016-06-23 14:04:09
Original
865 people have browsed it

Array(    [0] => Array        (            [title] => testtile                       [advantage] => 三三四四            [fault] => 三三四四            [rank] => 4            [time] => 1364364088            [pic] => Array                (                    [0] => ../../i/uploadpic/1364367652985664.gif                    [1] => ../../i/uploadpic/1364367662409433.gif                    [2] => ../../i/uploadpic/1364367672711762.gif                    [3] => 0                    [4] => 0                )        )    [1] => Array        (            [title] => 晒单测试1111111               [advantage] => 晒单测试1111111            [fault] => 晒单测试1111111            [rank] => 5            [time] => 1364364271            [pic] => Array                (                    [0] => ../../i/uploadpic/1364367652985664.gif                    [1] => ../../i/uploadpic/1364367662409433.gif                    [2] => ../../i/uploadpic/1364367672711762.gif                    [3] => 0                    [4] => 0                )        ))<!--{foreach from=$evaluate item=comment}-->    <!--{foreach from=$comment.pic item=child}-->           <li><img  src="{$child}"    style="max-width:90%"  style="max-width:90%" alt="smarty 循环" ></li>    <!--{/foreach}-->  <!--{/foreach}-->             
Copy after login


上面这样循环不能读出pic 的数组值


回复讨论(解决方案)

查看源码看看

查看源码看看
我看了为空  li 就没有循环出来

   你这里是注释了吧,改为 {/foreach} 后试试,其他几个也都改掉。  

   你这里是注释了吧,改为 {/foreach} 后试试,其他几个也都改掉。  

不是这个原因。。。。 这样吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template