title: PHP combine two associative arrays into one array
body: <pre><code>$array1 = array("$name1" =&gt; "$id1");
  
  $array2 = array("$name2" =&gt; "$id2", "$name3" =&gt; "$id3");
  </code></pre>
  
  <p>I need a new array combining all together, i.e. it would be</p>
  
  <pre><code>$array3 = array("$name1" =&gt; "$id1", "$name2" =&gt; "$id2", "$name3" =&gt; "$id3");
  </code></pre>
  
  <p>What is the best way to do this?</p>
  
  <p>Sorry, I forgot, the ids will never match each other, but technically the names could, yet would not be likely, and they all need to be listed in one array.  I looked at array_merge but wasn't sure if that was best way to do this.  Also, how would you unit test this?</p>