怎么循环输出含有tr的td
程序员文章站
2024-02-06 14:04:16
...
如何循环输出含有tr的td
eg:$arr1=array("a","b","c","d","e","f","g");
循环上面的。
得到如下效果
a
b
c
d
e
f
g
以此类推,请问如何用PHP写出来
------解决方案--------------------
eg:$arr1=array("a","b","c","d","e","f","g");
循环上面的。
得到如下效果
以此类推,请问如何用PHP写出来
------解决方案--------------------
- PHP code
foreach(array_chunk($arr1,4) as $v){ echo "\n"; foreach($v as $t) echo " \n";};".$t." \n"; echo "
------解决方案--------------------
$arr1=array("a","b","c","d","e","f","g");
$i = 1;
echo '';
foreach ($arr1 as $key=>$val)
{
echo '' , $val, ' ';
if($i%4 == 0) echo ""; ';
++$i;
}
echo '相关文章
相关视频