我试图用文件来保存跳棋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