title: php array merge on key using multidimensional array
body: <p>This is my array:</p>
  
  <pre><code>array 
    0 =&gt; 
      array 
        'id' =&gt; int 220950
        'order_reference' =&gt; string '600125479' 
    1 =&gt; 
      array 
        'id' =&gt; int 220985
        'order_reference' =&gt; string '498638' 
  </code></pre>
  
  <p>and this my another array</p>
  
  <pre><code>array 
        0 =&gt; 
          array 
            'entity_id' =&gt; 1
            'order_status' =&gt; 'test' 
        1 =&gt; 
          array 
            'entity_id' =&gt; 2
            'order_status' =&gt; 'test2' 
  </code></pre>
  
  <p>and my goal is to achieve this:</p>
  
  <pre><code>array 
        0 =&gt; 
          array 
            'id' =&gt; int 220950
            'order_reference' =&gt; string '600125479'
            'entity_id' =&gt; 1
            'order_status' =&gt; 'test' 
        1 =&gt; 
          array 
            'id' =&gt; int 220985
            'order_reference' =&gt; string '498638'
            'entity_id' =&gt; 2
            'order_status' =&gt; 'test2'
  </code></pre>
  
  <p>with array_merge I managed to get this(NOT my desired goal) and this all I found on stackoverflow and other forums:</p>
  
  <pre><code>array 
        0 =&gt; 
          array 
            'id' =&gt; int 220950
            'order_reference' =&gt; string '600125479' 
        1 =&gt; 
          array 
            'id' =&gt; int 220985
            'order_reference' =&gt; string '498638' 
           array 
        2 =&gt; 
          array 
            'entity_id' =&gt; 1
            'order_status' =&gt; 'test'
        3 =&gt; 
          array 
            'entity_id' =&gt; 2
            'order_status' =&gt; 'test2'
  </code></pre>
  
  <p>Any ideas or suggestions are welcomed :) thank you</p>
  
  <p>Using a foreach I can add the keys values, but I am looking for a more cleanest way :) </p>