title: Merge One Array Key And Another Array Value PHP
body: <p>I have two array As Follow</p>
  
  <p><strong>Array 1</strong>(<em>this is default array</em>)</p>
  
  <pre><code>Array
  (
      [0] =&gt; pname
      [1] =&gt; minmrpprice
      [2] =&gt; maxmrpprice
      [3] =&gt; unittype
      [4] =&gt; minorder
      [5] =&gt; pdetails
      [6] =&gt; status
      [7] =&gt; product_group
      [8] =&gt; specification
  )
  </code></pre>
  
  <p><strong>Array 2</strong>(<em>this is dynamic array</em>)</p>
  
  <pre><code>Array
  (
      [pname] =&gt; Designer Dress By Textilemart
      [h1] =&gt; 1
      [userid] =&gt; textilemart
      [minmrpprice] =&gt; 1212
      [maxmrpprice] =&gt; 
      [unittype] =&gt; Piece
      [minorder] =&gt; 12
      [pdetails] =&gt; adsfadf
      [_wysihtml5_mode] =&gt; 1
      [status] =&gt; 1
      [product_group] =&gt; 2
      [addGroupInput] =&gt; 
      [categories] =&gt; 2
      [0] =&gt; 299
      [1] =&gt; 84
      [2] =&gt; 71
      [3] =&gt; 45
      [specification] =&gt; 84
      [4] =&gt; 
      [submit] =&gt; Update Product
  )
  </code></pre>
  
  <p>Now all i need is i want to merge array 1 value with array 2 key and </p>
  
  <ol>
  <li>Get only elements that have value in Array2</li>
  <li>remove all other key and values</li>
  </ol>
  
  <p>As Result for above Example is as follow</p>
  
  <pre><code>Array
  (
      [0] =&gt; pname
      [1] =&gt; minmrpprice
      //[2] =&gt; maxmrpprice(THIS DON'T SHOW BECAUSE VALUE IS EMPTY)
      [3] =&gt; unittype
      [4] =&gt; minorder
      [5] =&gt; pdetails
      [6] =&gt; status
      [7] =&gt; product_group
      [8] =&gt; specification
  )
  </code></pre>
  
  <p>I also Tried merge_array but it returns me like this</p>
  
  <pre><code>Array
  (
      [0] =&gt; pname
      [1] =&gt; minmrpprice
      [2] =&gt; maxmrpprice
      [3] =&gt; unittype
      [4] =&gt; minorder
      [5] =&gt; pdetails
      [6] =&gt; status
      [7] =&gt; product_group
      [8] =&gt; specification
      [pname] =&gt; Designer Dress By Textilemart
      [h1] =&gt; 1
      [userid] =&gt; textilemart
      [minmrpprice] =&gt; 1212
      [maxmrpprice] =&gt; 
      [unittype] =&gt; Piece
      [minorder] =&gt; 12
      [pdetails] =&gt; adsfadf
      [_wysihtml5_mode] =&gt; 1
      [status] =&gt; 1
      [product_group] =&gt; 2
      [addGroupInput] =&gt; 
      [categories] =&gt; 2
      [9] =&gt; 299
      [10] =&gt; 84
      [11] =&gt; 71
      [12] =&gt; 45
      [specification] =&gt; 84
      [13] =&gt; 
      [submit] =&gt; Update Product
  )
  </code></pre>
  
  <p>i do not need like this</p>