//Declare a three-dimensional array
$info=array(
"user"=>array(
array(1,"zhangsan",20,"nan"),
array(2,"lisi",20,"nan"),
array(3,"wangwu",25,"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 through and output a table
foreach($info as $tableName=>$table){
echo "
";
echo "".$tableName."
";//With the key of each array Value as table name
foreach($table as $row){
echo "";
foreach($row as $col){
echo "". $col." | ";
}
echo "
";
}
echo "
";
}
?>