title: PHP Array Merge two Arrays on same key
body: <p>I am trying to merge the following two arrays into one array, sharing the same key:</p>
  
  <p><strong>First Array:</strong></p>
  
  <pre><code>array(3) {
    [0]=&gt;
     array(1) {
     ["Camera1"]=&gt;
     string(14) "192.168.101.71"
  }
  [1]=&gt;
  array(1) {
    ["Camera2"]=&gt;
    string(14) "192.168.101.72"
  }
  [2]=&gt;
  array(1) {
    ["Camera3"]=&gt;
    string(14) "192.168.101.74"
  }
  }
  </code></pre>
  
  <p><strong>Second Array:</strong></p>
  
  <pre><code>array(3) {
   [0]=&gt;
    array(1) {
    ["Camera1"]=&gt;
    string(2) "VT"
   }
   [1]=&gt;
   array(1) {
     ["Camera2"]=&gt;
     string(2) "UB"
   }
   [2]=&gt;
   array(1) {
    ["Camera3"]=&gt;
    string(2) "FX"
   }
  }
  </code></pre>
  
  <p>As you can see, they share the same key (Camera1, Camera2, Camera3, etc..)</p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code> $Testvar = array_merge($NewArrayCam,$IpAddressArray);
   foreach ($Testvar AS $Newvals){
   $cam = array();
   foreach($Newvals AS $K =&gt; $V){
   $cam[] = array($K =&gt; $V);
   }
  </code></pre>