title: PHP Create multidimensional array with parser
body: <p>I have a parsed html data fetched with <code>@file_get_contents($url)</code> which is like</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;var stock = 
  new Array();
  stock['704'] = new Array('92 (1-2)', 913, 'n.A.', '104 (3-4)', 2371, 'n.A.', '116 (5-6)', 1921, 'n.A.', '128 (7-8)', 4626, 'n.A.', '140 (9-10)', 4222, 'n.A.', '152 (11-12)', 4281, 'n.A.');
  stock['101'] = new Array('92 (1-2)', 3444, 'n.A.', '104 (3-4)', 10136, 'n.A.', '116 (5-6)', 18834, 'n.A.', '128 (7-8)', 30662, 'n.A.', '140 (9-10)', 28981, 'n.A.', '152 (11-12)', 25982, 'n.A.');
  stock['540'] = new Array('92 (1-2)', 505, 'n.A.', '104 (3-4)', 1220, 'n.A.', '116 (5-6)', 1634, 'n.A.', '128 (7-8)', 1381, 'n.A.', '140 (9-10)', 3187, 'n.A.', '152 (11-12)', 5014, 'n.A.');
  stock['700'] = new Array('92 (1-2)', 401, 'n.A.', '104 (3-4)', 724, 'n.A.', '116 (5-6)', 1078, 'n.A.', '128 (7-8)', 1247, 'n.A.', '140 (9-10)', 2767, 'n.A.', '152 (11-12)', 2207, 'n.A.');
  stock['448'] = new Array('92 (1-2)', 517, 'n.A.', '104 (3-4)', 727, 'n.A.', '116 (5-6)', 1721, 'n.A.', '128 (7-8)', 1537, 'n.A.', '140 (9-10)', 2382, 'n.A.', '152 (11-12)', 1820, 'n.A.');
  stock['423'] = new Array('92 (1-2)', 876, 'n.A.', '104 (3-4)', 1110, 'n.A.', '116 (5-6)', 5196, 'n.A.', '128 (7-8)', 3159, 'n.A.', '140 (9-10)', 7727, 'n.A.', '152 (11-12)', 3656, 'n.A.');
  stock['121'] = new Array('92 (1-2)', 781, 'n.A.', '104 (3-4)', 13363, 'n.A.', '116 (5-6)', 13300, 'n.A.', '128 (7-8)', 1964, 'n.A.', '140 (9-10)', 3591, 'n.A.', '152 (11-12)', 2552, 'n.A.');
  stock['719'] = new Array('92 (1-2)', 188, 'n.A.', '104 (3-4)', 1313, 'n.A.', '116 (5-6)', 2109, 'n.A.', '128 (7-8)', 2076, 'n.A.', '140 (9-10)', 2292, 'n.A.', '152 (11-12)', 2674, 'n.A.');    var imageTmp = new Array();
  &lt;/script&gt;&lt;body&gt;
  </code></pre>
  
  <p>final output which i require is MultiDimensional Array which needs to be like this. The values like 92 (1-2) could be alphabets as well.</p>
  
  <pre><code>Array
  (
      [704] =&gt; Array
          (
              [92 (1-2)] =&gt; Array
          (
              [qty] =&gt; 913
              [price] =&gt; n.A
  
          )
              [104 (3-4)] =&gt; Array
          (
              [qty] =&gt; 2371
              [price] =&gt; n.A
  
          )
              [116 (5-6)] =&gt; Array
          (
              [qty] =&gt; 1921
              [price] =&gt; n.A
  
          )       
          )
  
      [101] =&gt; Array
          (
              [92 (1-2)] =&gt; Array
          (
              [qty] =&gt; 3444
              [price] =&gt; n.A
  
          )
              [104 (3-4)] =&gt; Array
          (
              [qty] =&gt; 10136
              [price] =&gt; n.A
  
          )
              [116 (5-6)] =&gt; Array
          (
              [qty] =&gt; 18834
              [price] =&gt; n.A
  
          )       
          )
  
      [700] =&gt; Array
          (
              [XS] =&gt; Array
          (
              [qty] =&gt; 3444
              [price] =&gt; n.A
  
          )
              [L] =&gt; Array
          (
              [qty] =&gt; 10136
              [price] =&gt; n.A
  
          )
              [S] =&gt; Array
          (
              [qty] =&gt; 18834
              [price] =&gt; n.A
  
          )       
          )
  
  )
  </code></pre>
  
  <p>how could i get this</p>