$counts = array_count_values($array); $duplicate_title = array_filter($array, function ($value) use ($counts) { return $counts[$value] > 1; });