title: Group array by subarray values
body: <p>I have an array of subarrays in the following format:</p>
  <pre><code>array
  (
      a =&gt; array ( id = 20, name = chimpanzee )
      b =&gt; array ( id = 40, name = meeting )
      c =&gt; array ( id = 20, name = dynasty )
      d =&gt; array ( id = 50, name = chocolate )
      e =&gt; array ( id = 10, name = bananas )
      f =&gt; array ( id = 50, name = fantasy )
      g =&gt; array ( id = 50, name = football )
  )
  </code></pre>
  <p>And I would like to group it into a new array based on the id field in each subarray.</p>
  <pre><code>array
  (
      10 =&gt; array
            (
              e =&gt; array ( id = 10, name = bananas )
            )
      20 =&gt; array
            (
              a =&gt; array ( id = 20, name = chimpanzee )
              c =&gt; array ( id = 20, name = dynasty )
            )
      40 =&gt; array
            (
              b =&gt; array ( id = 40, name = meeting )
            )
      50 =&gt; array
            (
              d =&gt; array ( id = 50, name = chocolate )
              f =&gt; array ( id = 50, name = fantasy )
              g =&gt; array ( id = 50, name = football )
            )
  )
  </code></pre>