title: Merging two arrays with the same keys
body: <p>I need a help with merging two arrays. Let's say I have following arrays:</p>
  
  <pre><code>Array
  (
  [3] =&gt; Array
      (
          [id] =&gt; 3
          [name] =&gt; Lorem
          [type] =&gt; pl
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 2
          [name] =&gt; Ipsum
          [type] =&gt; pl
      )
  
  )
  </code></pre>
  
  <p>And the second one:</p>
  
  <pre><code>Array
  (
      [6] =&gt; Sit dolor
      [4] =&gt; nostrud exercitation ullamco
      [3] =&gt; uuntur magni dolores
      [2] =&gt; corporis suscipit laboriosam
      [7] =&gt;  quia non numquam eius modi tempora
   )
  </code></pre>
  
  <p>And desired output is:</p>
  
  <pre><code>Array
  (
  [3] =&gt; Array
      (
          [id] =&gt; 3
          [name] =&gt; Lorem
          [type] =&gt; pl
          [new_key] =&gt; uuntur magni dolores
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 2
          [name] =&gt; Ipsum
          [type] =&gt; pl
          [new_key] =&gt; corporis suscipit laboriosam
      )
  )
  </code></pre>
  
  <p>I have been trying to compare arrays with <code>array_diff_key()</code> method and than merge arrays in some loop, but I could't get it working. Is there any built in PHP function, or should I write my own? If so, could you help me with getting desired result? Any help is much appreciated.</p>