......
<table border="1"> <{section name=i loop=$arrs}> <tr> <{section name=j loop=$arrs[i]}> <td><{$arrs[i][j]}></td> <{/section}> </tr> <{/section}> </table> <{section name=i loop=$arr start=5 step=2 max=6}> <{$arr[i]}>, <{/section}>
<?php header("Content-type: text/html; charset=utf-8"); //设置中国时区 date_default_timezone_set('PRC'); require_once("./Smarty/libs/Smarty.class.php"); $smarty = new Smarty(); $smarty->left_delimiter="<{"; $smarty->right_delimiter="}>"; $arrs=array( array(1,'孙悟空','花果山'), array(2,'猪八戒','高老庄'), array(3,'沙和尚','流沙河'), array(4,'唐三藏','东土大唐') ); $smarty->assign("arrs",$arrs); $arr=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); $smarty->assign("arr",$arr); // var_dump($arrs); $smarty->display("./view.html");
标签:arr,max,section,smarty,start,arrs,array From: https://www.cnblogs.com/hnqyliu/p/17369754.html