我有一个像这样的多维数组
Array
(
[0] => Array
(
[name] => Fernando Alonso
[time1] => 3.25
[time2] => 3.25
[time3] => 3.5
)
[1] => Array
(
[name] => Jenson Button
[time1] => 34
[time2] => 34
[time3] => 41
)
)
我想将数据回显到一个表中,目前我正在使用($result 是数组)
foreach ($result as $result) {
echo "<tr>";
foreach ($result as $driver) {
echo "<td>$driver</td>";
}
echo "</tr>";
}
这似乎有点不必要,有没有更好的方法来做到这一点?