title: Store and retrieve a multidimensional array using php and mysql
body: <p>I have a multidimensional array in PHP like this:</p>
  
  <pre><code>$array = array(
      "Part1" =&gt; array(
          "Subpart1" =&gt; array(0, 1),
          "Subpart2" =&gt; array(1, 0)
      ),
      "Part2" =&gt; array(0),
      "Part3" =&gt; array(0, 1, 0)
  );
  </code></pre>
  
  <p>Now I want to store this array in a MySQL table and retrieve it exactly like this again on another PHP page.</p>
  
  <p>I've been trying using <code>serialize()</code> and <code>unserialize()</code></p>
  
  <pre><code>$array= serialize($array);
  </code></pre>
  
  <p>and then on the other page</p>
  
  <pre><code>$array= $row['Array'];
  $array2 = array();
  $array2 = unserialize($array);
  </code></pre>
  
  <p>But I seem to do something wrong, in the beginning I got a <code>var_dump</code> of <em>bool(false)</em> and now I get a <code>var_dump</code> of <em>NULL</em>.</p>