$values = array('a', 'a', 'b', 'c', 'c');
$result = array_keys(array_filter(array_count_values($values), function($v){
return $v > 1;
}));
print_r($values);
print_r($result);
Array
(
[0] => a
[1] => a
[2] => b
[3] => c
[4] => c
)
Array
(
[0] => a
[1] => c
)