
就是这些被红字的数字,每行3个,所有偶数行的数字应该怎么通过数学的方法算出来?
取余的话取的是纵列的数字,怎么样能把红字的偶数行给表达出来?
数学
------解决方案--------------------
smarty ??
他不是有个 cycle 控制变量吗?为什么不用!
test.php
include_once("smarty_inc.php");
$arr=array('a','b','c','d','e','f');
$smarty->assign('arr',$arr);
$smarty->display("test.tpl");
test.tpl
<table width="100px">
{section name=a loop=$arr}
<tr bgcolor="{cycle values="#eeeeee,#55eero"}">
<td>
{$arr[a]}
</td>
</tr>
{/section}
</table>