我試圖用文件來保存跳棋PHP我如何寫一個多dimmensional數組文件
這是數組的數組
$board = array(
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0),
array(0,0,0,0,0,0,0,0,0)
);
同時還贈送價值,這樣我可以設定置於一個預定的位置有關的多條板開始啓動遊戲然後讓他們的用戶輸入他們想要的作品進入
哪個位置我已經有這個while循環
$row = 0;
print "<form>";
print "<table border = 1>";
while ($row < 8){ // Counts to 8. (from 0...7 = 8 times. 0 ... 8 = 9 times)
print "<tr>";
$row++;
$col = 0; // reset column to 0 each time printing one row.
while ($col < 8){
print "<td>";
if($Board[$row][$col] == 0)
{
$value=$row.$col;
print "<input type=\"checkbox\" name=\"box[]\" value=\"$value\">";
// Add \ before " otherwise it will treat as the end of the quote.
}
print "</td>";
$col++;
}
print "</tr>";
}
print "</table>";
print "</form>";
}
這個家庭作業? – JohnFx 2010-11-04 21:08:15
我想知道的是,我需要將這個數組存儲在文件中,然後將顯示板顯示爲具有8x8行和列的html表格。 – hgbso 2010-11-04 21:08:33
排序作業 – hgbso 2010-11-04 21:10:03