I cannot tell if $cell_old
is an array or a string but here is the code assuming string. If not no need to explode.
$cell_old ='a,b,c,d,d,d,d,a,d,e,d';
//Explode on , if not already an array.
$cell_old_array = explode(',',$cell_old);
$counts = array_count_values($cell_old_array);
The content of $counts is:
Array ( [a] => 2 [b] => 1 [c] => 1 [d] => 6 [e] => 1 )
so now all you would need to do is loop the $counts
and store the key of values of 6
foreach($counts as $k => $v){
if($v >= 6){
//store $k how you want?
}
}