PHP how do i write a multi dimmensional array into file
<p>I am trying to use files to hold an array for checkers</p>

<p>this is the array</p>

<pre><code>$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)
   );
</code></pre>

<p>while also giving the values so that i can set the beginning of the board with the pieces placed in a predefined positions to start the game in then have them user input which location they want to move the pieces into</p>

<p>I already have this while loop</p>

<pre><code>      $row = 0;
    print "&lt;form&gt;";
    print "&lt;table border = 1&gt;";
    while ($row &lt; 8){ // Counts to 8. (from 0...7 = 8 times. 0 ... 8 = 9 times)
       print "&lt;tr&gt;";
       $row++;
       $col = 0; // reset column to 0 each time printing one row.

       while ($col &lt; 8){
        print "&lt;td&gt;";
        if($Board[$row][$col] == 0)
        {
            $value=$row.$col;
            print "&lt;input type=\"checkbox\" name=\"box[]\" value=\"$value\"&gt;";
            // Add \ before " otherwise it will treat as the end of the quote.

        }
        print "&lt;/td&gt;";
        $col++;

       }

       print "&lt;/tr&gt;";

    }
    print "&lt;/table&gt;";
    print "&lt;/form&gt;";
</code></pre>

<p>}</p>
