title: Rearranging multidimensional array
body: <p>I have an array in the following format:</p>
  
  <pre><code>Array (
      [0] =&gt; Array
          (
              [0] =&gt; a
              [1] =&gt; b
              [2] =&gt; c
          )
      [1] =&gt; Array
          (
              [0] =&gt; d
              [1] =&gt; e
              [2] =&gt; f
          )
      [2] =&gt; Array
          (
              [0] =&gt; 0
              [1] =&gt; 0
              [2] =&gt; 0
          )
      [3] =&gt; Array
          (
              [0] =&gt; 100
              [1] =&gt; 200
              [2] =&gt; 300
          )
  )
  </code></pre>
  
  <p>The indices in the first array(outer), i.e. 0 is for name, 1 for type, 2 for error and 3 for size.</p>
  
  <p>I have to rearrange this array in the following format:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [name] =&gt; a
              [type] =&gt; d
              [error] =&gt; 0
              [size] =&gt; 100
          )
      [1] =&gt; Array
          (
              [name] =&gt; b
              [type] =&gt; e
              [error] =&gt; 0
              [size] =&gt; 200
          )
      [2] =&gt; Array
          (
              [name] =&gt; c
              [type] =&gt; f
              [error] =&gt; 0
              [size] =&gt; 300
          )
  )
  </code></pre>
  
  <p>Is there any short method to sort out this?</p>