title: PHP Array merge with keys match
body: <p>Having Two arrays need to Merge two arrays with matching their keys and rest should be empty. I have tried array_merge, array_diff, array_fill but nothing helped iam bit newbie, Thanks in advance.</p>
  
  <p><strong>Array one</strong> </p>
  
  <pre><code>Array
      (
          [5] =&gt; PHM
          [4] =&gt; ODM
          [3] =&gt; N
          [6] =&gt; M9
          [10] =&gt; RDM9
      )
  </code></pre>
  
  <p><strong>array 2</strong></p>
  
  <pre><code> Array
    (
      [0] =&gt; 01
      [1] =&gt; 02
      [2] =&gt; 03
      [3] =&gt; 04
      [4] =&gt; 05
      [5] =&gt; 06
      [6] =&gt; 07
      [7] =&gt; 08
      [8] =&gt; 09
      [9] =&gt; 10
      [10] =&gt; 11
      [11] =&gt; 12
      [12] =&gt; 13
     )
  </code></pre>
  
  <p><strong>Final Output</strong></p>
  
  <pre><code>Array
    (
      [0] =&gt; null 
      [1] =&gt; null 
      [2] =&gt; null 
      [3] =&gt; N
      [4] =&gt; ODM
      [5] =&gt; PHM
      [6] =&gt; M9
      [7] =&gt; null 
      [8] =&gt; null 
      [9] =&gt; null 
      [10] =&gt; RDM9
      [11] =&gt;  null   
      [12] =&gt; null 
     )
  </code></pre>