title: Merging two arrays by index
body: <p>Okay, if feel like this should be really simple and accomplished by a function like <code>array_merge()</code> or <code>array_merge_recursive</code>, but I can't quite figure it out.  I have two simple arrays structured like the (simplified) example below.  I simply want to merge them into one array based on their index.</p>
  
  <p><strong>$array 1:</strong></p>
  
  <pre><code>Array ( 
    [0] =&gt; Array ( 
          [ID] =&gt; 201 
          [latLng] =&gt; 45.5234515, -122.6762071 
    )  
    [1] =&gt; Array ( 
          [ID] =&gt; 199 
          [latLng] =&gt; 37.7931446, -122.39466520000002 
    )
  ) 
  </code></pre>
  
  <p>et cetera…</p>
  
  <p><strong>$array2 :</strong></p>
  
  <pre><code>Array ( 
    [0] =&gt; Array ( 
          [distance] =&gt; 1000 
          [time] =&gt; 10 
    )  
    [1] =&gt; Array ( 
          [distance] =&gt; 1500 
          [time] =&gt; 15 
    )
  ) 
  </code></pre>
  
  <p><strong>$desiredResult :</strong></p>
  
  <pre><code>Array ( 
    [0] =&gt; Array ( 
          [ID] =&gt; 201 
          [latLng] =&gt; 45.5234515, -122.6762071 
          [distance] =&gt; 1000 
          [time] =&gt; 10 
   )  
    [1] =&gt; Array ( 
          [ID] =&gt; 199 
          [latLng] =&gt; 37.7931446, -122.39466520000002 
          [distance] =&gt; 1500 
          [time] =&gt; 15 
   )
  ) 
  </code></pre>
  
  <p>When I try to merge these using merge functions, I can only get this:</p>
  
  <p><strong>$unDesiredResult:</strong></p>
  
  <pre><code>Array ( 
    [0] =&gt; Array ( 
          [ID] =&gt; 201 
          [latLng] =&gt; 45.5234515, -122.6762071 
    )  
    [1] =&gt; Array ( 
          [ID] =&gt; 199 
          [latLng] =&gt; 37.7931446, -122.39466520000002 
    )
    [2] =&gt; Array ( 
          [distance] =&gt; 1000 
          [time] =&gt; 10 
    )  
    [3] =&gt; Array ( 
          [distance] =&gt; 1500 
          [time] =&gt; 15 
    )
  ) 
  </code></pre>
  
  <p>Do I need to loop through to push the second set into the first, or can this be done with an existing function?</p>