title: Transform PHP array
body: <p>I have a PHP array that I'm trying to transform into a different format, the only way I can think to do it would be a lot longer than it seems like it should need.</p>
  
  <p>Example data:</p>
  
  <pre><code>Array (
  [0] =&gt; Array (
      [type] =&gt; a
      [value] =&gt; 1
      )
  [1] =&gt; Array (
      [type] =&gt; a
      [value] =&gt; 2
      )
  [2] =&gt; Array (
      [type] =&gt; a
      [value] =&gt; 3
      )
  [3] =&gt; Array (
      [type] =&gt; b
      [value] =&gt; 1
      )
  [4] =&gt; Array (
      [type] =&gt; b
      [value] =&gt; 4
      )
  [5] =&gt; Array (
      [type] =&gt; f
      [value] =&gt; 2
      )
  ) 
  </code></pre>
  
  <p>Into:</p>
  
  <pre><code>Array (
  'a' =&gt; Array(1,2,3),
  'b' =&gt; Array(1,4),
  'f' =&gt; Array(2)
  )
  </code></pre>