title: Merging two arrays by index or combine array?
body: <p>I have two simple arrays structured like the (simplified) example below. I simply want to merge them into one array.</p>
  <p><strong>$array1 :</strong></p>
  <pre><code>Array ( 
    [0] =&gt; Array ( 
      [user_id] =&gt; 65
      [paid] =&gt; 24809
    )  
    [1] =&gt; Array ( 
      [user_id] =&gt; 54
      [paid] =&gt; 3574      
    )
  ) 
  </code></pre>
  <p><strong>$array2 :</strong></p>
  <pre><code>Array (
   [0] =&gt; Array (
      [user_id] =&gt; 54
      [unpaid] =&gt; 42277
  )  
   [1] =&gt; Array (
     [user_id] =&gt; 65
     [unpaid] =&gt; 3860
  )
   [2] =&gt; Array (
     [user_id] =&gt; 5
    [unpaid] =&gt; 3860
   )
  ) 
  </code></pre>
  <p><strong>$desiredResult :</strong></p>
  <pre><code>Array (
   [0] =&gt; Array (
      [user_id] =&gt; 54
      [paid] =&gt; 3574  
      [unpaid] =&gt; 42277
  )  
   [1] =&gt; Array (
     [user_id] =&gt; 65
     [paid] =&gt; 24809
     [unpaid] =&gt; 3860
  )
   [2] =&gt; Array (
     [user_id] =&gt; 5
     [paid] =&gt; 24809
     [unpaid] =&gt; 3860
    )
  ) 
  </code></pre>