convert string to predefined 2D array
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8785815/convert-string-to-2d-array-using-php">convert string to 2D array using php</a>  </p>
</blockquote>



<p>I have the string like the following:</p>

<pre><code>01,03,02,15|05,04,06,10|07,09,08,11|12,14,13,16
</code></pre>

<p>how can I convert the above string to a defined array like the one below:</p>

<pre><code>$a[0] = array('column' =&gt; array("row1" =&gt; "01", "row2"=&gt; "05", "row3" =&gt; "07", "row4" =&gt;"12"));
$a[1] = array('column' =&gt; array("row1" =&gt; "03", "row2"=&gt; "04", "row3" =&gt; "09", "row4" =&gt;"14"));
$a[2] = array('column' =&gt; array("row1" =&gt; "02", "row2"=&gt; "06", "row3" =&gt; "08", "row4" =&gt;"13"));
$a[3] = array('column' =&gt; array("row1" =&gt; "15", "row2"=&gt; "10", "row3" =&gt; "11", "row4" =&gt;"16"));
</code></pre>

<p>I know I should use explode function but not sure how exactly it should be implemented for this, any help would be greatly appreciated, thanks!</p>
