. The code is as follows:
<?php
//Declaration of a three-dimensional array
$info =array (
"User" =>array (
Array (1, "Zhangsan", "Nan"),
Array (2, "Lisi", "Nan"),
Array (3, "Wangwu", "NV")
),
"Score" =>array (
Array (1,100,98,95,96),
Array (2,56,98,87,84),
Array (3,68,75,84,79)
),
"Connect" =>array (
Array (1, ' 2468246 ', "salkh@bbs.com"),
Array (2, ' 343681643 ', "aikdki@sina.com"),
Array (3, ' 3618468 ', "42816@qq.com")
)
);
//loop traversal, output a table
foreach ($info as $tableName => $table) {
echo "<table align= ' center ' border= ' 1 ' width=300>";
echo "<caption><h1>". $tableName. " </h1></caption>//With the key value of each array as the table name
foreach ($table as $row) {
echo "<tr>";
foreach ($row as $col) {
echo "<td>". $col. " </td> ";
}
echo "</tr>";
}
echo "</table>";
}
?>