Taking the advantage of array_unique, here is a simple function to check if an array has duplicate values.
It simply compares the number of elements between the original array and the array_uniqued array.
<?php
function array_has_duplicates(array $array)
{
$uniq = array_unique($array);
return count($uniq) != count($array);
}
?>