我正在使用foreach并implode使用以下代码运行:
$i = 0;
foreach ($dates as $date=>$hour)
{
?>
<th><?php echo $i." ".implode("</th>\n\t\t<th>\n", $hour); ?></th>
<?php
$i++;
}
目标是显示递增的列号,但正如我在上面的代码中测试的那样,它只显示了数字 1。
我的问题是:如何使用 PHP 自动编号/增加表中每列的编号?
喵喔喔
相关分类