title: How to compare arrays and extract the difference?
body: <p>I have two arrays that I would like to compare and ultimately wind up with a single array with everything combined, <strong>having no duplicates</strong>. Can someone please tell me which function I should use? There are so many that it's a bit confusing.</p>
  
  <pre><code>$array1[]['name'] = 'Kim, Jones';
  $array1[]['name'] = 'Jim, Miller';
  </code></pre>
  
  <p>array1 is an array I built that I want added to an array coming from the database. The key in the second array is also named "name". Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I managed to merge these two arrays but I can still see duplicates.</p>
  
  <p>This is what the first array looks like:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [WNumber] =&gt; ADMIN
              [Name] =&gt; Tim, Cooley
              [Employer] =&gt; CalPERS
              [Student] =&gt; 1
              [Perm] =&gt; 1
              [QA] =&gt; 0
              [Supervisor] =&gt; 1
              [RQW] =&gt; 0
          )
  </code></pre>
  
  <p>My second array is built like this:</p>
  
  <pre><code>$add_names[]['Name']='Jim, Jones';
  </code></pre>
  
  <p>I just want to add $add_names to the first array WHERE there are no duplicates.</p>