title: Comparing 2 objects PHP
body: <p>i need to compare 2 objects to remove duplicates / find new enteries.</p>
  
  <p>The objects are not identical, but they contain the same username key</p>
  
  <p>Here is the layout</p>
  
  <p>database object</p>
  
  <pre><code>array
    [0]db-&gt;username
    [0]db-&gt;something
    [1]db-&gt;username
    [1]db-&gt;something
    etc
  </code></pre>
  
  <p>other object</p>
  
  <pre><code>array
    [0]ob-&gt;username
    [0]ob-&gt;somethingElse
    [1]ob-&gt;username
    [1]ob-&gt;somethingElse
    etc
  </code></pre>
  
  <p>I imagine i can loop one array of objects, and compare the $db[$key]->username with an internal loop of the other object $ob[$key]->username but is there a cleaner way ?</p>
  
  <p>I am looking to remove duplicates</p>