联系官方销售客服
1835022288
028-61286886
$arr = array( "file" => array("file1.jpg", "file2.jpg", "file3.jpg", "file4.jpg"), "title" => array("title1", "title2", "title3", "title4") ); foreach($arr['file'] as $i=>$r) { echo $arr['title'][$i]."=".$r;echo "<br />"; }
当碰到这样的数组时 在loop中如何循环
{loop $block2.file $key $file} <div class="item {if $key==0} active {/if}"> <a href="{$block2[title][$key]}"> <img src="{dr_get_file($file)}" alt="keep" class="img-responsive" style="width: 100%"> </a> <div class="carousel-caption"> </div> </div> {/loop}
loop实际上登录foeach 想明白这点就好解决了
推荐我这样写,因为原生php代码更快,毕竟模板标签最终效果会转移成原生php语法