The simplest way to get around the fact that max() won't give the key is array_search:
<?php
$student_grades = array ("john" => 100, "sarah" => 90, "anne" => 100);
$top_student = array_search(max($student_grades),$student_grades); // john
?>
This could also be done with array_flip, though overwriting will mean that it gets the last max value rather than the first:
<?php
$grades_index = array_flip($student_grades);
$top_student = $grades_index[max($student_grades)]; // anne
?>
To get all the max value keys:
<?php
$top_students = array_keys($student_grades,max($student_grades)); // john, anne
?>