smarty二维数组读取
程序员文章站
2022-05-01 16:58:37
...
{foreach item=foo from=$video key=fkey0}
{foreach item=foo_ from=$foo key=fkey1}
<div class="123">
< src='{$foo_}'></><a href="{$fkey0}">{$fkey1}</a></p>
</div>
{/foreach}
{/foreach}
二维数组smarty读取
[8] => Array
(
[动画短片《RUN!PIG!] => http://player.youku.com/player.php/sid/XNDIxMTMzNjg0/v.swf
)
[7] => Array
(
[爱情公寓 第三季] => http://player.youku.com/player.php/sid/XNDMzNDAzNjQw/v.swf
)
[6] => Array
(
[轩辕剑之天之痕] => http://player.youku.com/player.php/sid/XNDMwNTgxNDU2/v.swf
)
[5] => Array
(
[钟馗传说] => http://player.youku.com/player.php/sid/XNDM0MTc3NjI0/v.swf
)
while($rows=mysql_fetch_assoc($result))
{
$re_array[$row1['name']][$row1['img']]=$row1['link'];
}
{foreach item=foo_ from=$foo key=fkey1}
<div class="123">
< src='{$foo_}'></><a href="{$fkey0}">{$fkey1}</a></p>
</div>
{/foreach}
{/foreach}
二维数组smarty读取
[8] => Array
(
[动画短片《RUN!PIG!] => http://player.youku.com/player.php/sid/XNDIxMTMzNjg0/v.swf
)
[7] => Array
(
[爱情公寓 第三季] => http://player.youku.com/player.php/sid/XNDMzNDAzNjQw/v.swf
)
[6] => Array
(
[轩辕剑之天之痕] => http://player.youku.com/player.php/sid/XNDMwNTgxNDU2/v.swf
)
[5] => Array
(
[钟馗传说] => http://player.youku.com/player.php/sid/XNDM0MTc3NjI0/v.swf
)
while($rows=mysql_fetch_assoc($result))
{
$re_array[$row1['name']][$row1['img']]=$row1['link'];
}