$v) { if ($v == $max) { $res[] = $k; } } echo min($res);