不確定這是你問的問題還是你的數組看起來像但可能會有幫助。
<?php
$array = array(array('FirstName', 'LastName'),array('FirstName1', 'LastName1'),array('FirstName2', 'LastName2'),array('FirstName3', 'LastName3'));
//count number inner arrays
$number = count($array);
// create table <table>, create table row <tr>
echo "<table><tr>";
//create table header number of times there are inner arrays
for($x = 0; $x<$number; $x++){
// create table data <td>, could also use table header <th>
echo "<td>name</td>";
}
//close table row and open a new one
echo "</tr><tr>";
//iterate through the array
foreach($array as $value){
// create the real table data
echo "<td> $value[0] $value[1]</td>";
}
// close table row and table
echo "</tr></table>";
?>
有太多可能的答案,或者對於這種格式太好的答案太長。請添加詳細信息以縮小答案集或隔離可在幾個段落中回答的問題。我建議您找到一個開發論壇(可能是[quora](http://www.quora.com/Computer-Programming) )?)來計算一般性。然後,當您遇到特定的編碼問題時,請回到StackOverflow,我們很樂意提供幫助。 –
請給我們你完成這個任務的嘗試,我們不是你的個人團隊的程序員。 –
你的數組是什麼樣的? – PHPhil