title: Combine two multidimensional arrays
body: <p>I have two multidimensional arrays like:</p>
  
  <pre><code>[a]
    [b]
      [c]             
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[a]
    [b]
      [c]
      [d]
  </code></pre>
  
  <p>and want to turn it into a single array</p>
  
  <pre><code>[a]
    [b]
      [c]
      [d]
  </code></pre>
  
  <p>I tried the <code>array_merge_recursive()</code> function, but it creates new elements on the last level instead of overwriting them.</p>
  
  <p>For example, if <code>[c]</code> is <code>"X"</code> in the first array, and <code>"Y"</code> in the second array, I get <code>array("X", "Y")</code> instead of the last value (<code>"Y"</code>).</p>