title: php: check if an array has duplicates
body: <p>I'm sure this is an extremely obvious question, and that there's a function that does exactly this, but I can't seem to find it. In PHP, I'd like to know if my array has duplicates in it, as efficiently as possible. I don't want to remove them like <code>array_unique</code> does, and I don't particularly want to run <code>array_unique</code> and compare it to the original array to see if they're the same, as this seems very inefficient. As far as performance is concerned, the "expected condition" is that the array has no duplicates.</p>
  
  <p>I'd just like to be able to do something like</p>
  
  <pre><code>if (no_dupes($array))
      // this deals with arrays without duplicates
  else
      // this deals with arrays with duplicates
  </code></pre>
  
  <p>Is there any obvious function I'm not thinking of?<br>
  <a href="https://stackoverflow.com/questions/1170807/how-to-detect-duplicate-values-in-php-array">How to detect duplicate values in PHP array?</a><br>
  has the right title, and is a very similar question, however if you actually read the question, he's looking for array_count_values.</p>