if(count(array_unique($array, SORT_REGULAR)) < count($array)) { // $array has duplicates } else { // $array does not have duplicates }