function($n, $b)
{
$array = array();
for ($a = $n; $a <= $b; $a++){
$count = 0;
for($j = $n; $j <= $a; $j++) {
if ($a%$j == 0) $count++;
}
$array[$a] = $count;
}
$max = max($array);
foreach ($array as $key => $value){
if ($value == $max) return $key;
}
}