$arr = [1,2,3,4,5,5,4,1,2,1,2,5,2,2,3,2];
$cnt = [];
foreach ($arr as $val) { //Считаем
$cnt[$val] = @$cnt[$val] + 1;
}
print_r($cnt);
$answer = 0;
$max = 0;
foreach ($cnt as $key=>$val) if ($val > $max) { //Ищем максимум
$max = $val;
$answer = $key;
}
print_r('Answer: '.$answer);