title: How to group subarrays by a column value?
body: <p>I have the following array</p>
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 96
              [shipping_no] =&gt; 212755-1
              [part_no] =&gt; reterty
              [description] =&gt; tyrfyt
              [packaging_type] =&gt; PC
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 96
              [shipping_no] =&gt; 212755-1
              [part_no] =&gt; dftgtryh
              [description] =&gt; dfhgfyh
              [packaging_type] =&gt; PC
          )
  
      [2] =&gt; Array
          (
              [id] =&gt; 97
              [shipping_no] =&gt; 212755-2
              [part_no] =&gt; ZeoDark
              [description] =&gt; s%c%s%c%s
              [packaging_type] =&gt; PC
          )
  
  )
  </code></pre>
  <p>How can I group the array by <code>id</code>? Is there any native php functions are available to do this?</p>
  <p>While this approach works, I want to do this using a <code>foreach</code>, since with the above I will get duplicate items, which I'm trying to avoid?</p>
  <p>On the above example <code>id</code> have 2 items, so its need to be inside of the <code>id</code></p>