No, but you can use the one I wrote below:
<?php
function dupes_in_array($array){
if(!is_array($array)) return 0;
$arr = array_count_values($array);
foreach($arr as $key => $val) { if($val > 1) $duplicates[] = $key; }
return $duplicates;
}
$array = array('red', 'blue', 'green', 'yellow', 'blue', 'black', 'green');
$dupes = dupes_in_array($array);
echo "Duplicate values: ";
var_dump($dupes);
?>
Conclusion:
Duplicate values: array(2) { [0]=> string(4) "blue" [1]=> string(5) "green" }
Note: the output is blue and green, because the input array has both of them as duplicates.
If $val- > 1, then we have a duplicate.
: array_count_values