title: Inserting Values Into Multidimensional Array, But Only Got 1 Inserted
body: <p>I have this array :</p>
  
  <pre><code>$order_list = array ( array ("tangible", 1, 8, 1, 19000),
                        array ("tangible", 6, 2, 10, NULL),
                        array ("tangible", 1, 17, 1, 28000));
  </code></pre>
  
  <p>and I want to have this as an output :</p>
  
  <pre><code>Array
  (
      [1] =&gt; Array       //$order_list[1]
          (
              [0] =&gt; 8   //$order_list[2]
              [1] =&gt; 17  //$order_list[2]
          )
  
      [6] =&gt; Array       //$order_list[1]
          (
              [0] =&gt; 2   //$order_list[2]
          )
  
  )
  </code></pre>
  
  <p>here's my code :</p>
  
  <pre><code>$order_array = array ();
  
  foreach ($order_list as $value) {
  
      $vendor_id = $value[1];
      $product_id = array($value[2]);
      $order_array[$vendor_id] = $product_id;
  
  }
  
  echo '&lt;pre&gt;';
  print_r($order_array);
  </code></pre>
  
  <p>this only produce :</p>
  
  <pre><code>    [1] =&gt; Array
          (
              [0] =&gt; 8
          )
  </code></pre>
  
  <p>how to have this :</p>
  
  <pre><code>    [1] =&gt; Array
          (
              [0] =&gt; 8
              [1] =&gt; 17 //second value inserted into same array
          )
  </code></pre>
  
  <p>thank you so much for your help.</p>