1$counts = array_count_values($array);
2 $duplicate_title = array_filter($array, function ($value) use ($counts) {
3 return $counts[$value] > 1;
4 });
1function has_dupes($array) {
2 $dupe_array = array();
3 foreach ($array as $val) {
4 if (++$dupe_array[$val] > 1) {
5 return true;
6 }
7 }
8 return false;
9}