循環可以說我有一個數組通過陣列中的多個細胞
$aSomeArray = array("1","2","3","4","5","6","7","8","9","10","11","12");
在一個錶行立即顯示一個數組值是容易這樣
echo "<table>";
foreach ($aSomeArray as $iSomeArrayKey => $iSomeArrayValue)
{
echo "<tr>";
echo "<td>".$iSomeArrayValue."</td>";
echo "</tr>";
}
echo "</table>";
但我想顯示的值這樣的表格格式
1 2 3 4
5 6 7 8
9 10 11 12
我該如何做到這一點?
你將如何確定在哪個索引處的數組迭代停止?它是否遵循一般的任何模式? – Dhiraj 2012-04-18 11:34:24
沒有任何特定的模式,我只想獲取數據顯示在多個TD而不是一次一個行 – skos 2012-04-18 11:35:52