这是我的代码并且工作正常但是当我显示 foreach 语句时它搞砸了!
$people= array(
array(
"name" => "Jennifer Kimbers",
"email" => "abc@gmail.com",
"city" => "Seattle",
"state" => "Washington"),
array(
"name" => "Rodney Hutchers",
"email" => "def@gmail.com",
"city" => "Los Angeles",
"state" => "California"),
);
echo "<table>";
echo "<th>FullName</th>";
echo "<th>Email</th>";
echo "<th>City</th>";
echo "<th>State</th>";
foreach ($people as $person)
{
foreach ($person as $key=>$values)
{
echo "<tr>";
echo "<td>$values</td>";
echo "</tr>";
}
}
我的问题是如何使用 foreach 语句显示组织的结果,例如:<th>Fullname<th>下面只有名称Jennifer Kimbers和下面Rodney Hutchers,然后旁边<th>Email<th>和下面abc@gmail.com以及下面def@gmail.com......等我已经搜索了这个论坛或互联网没有找到任何东西谢谢你的时间
繁花如伊
12345678_0001