Return index of highest value in an array

Viewed 117252

From an array that looks something like the following, how can I get the index of the highest value in the array. For the array below, the desired result would be '11'.

Array (
    [11] => 14
    [10] => 9
    [12] => 7
    [13] => 7
    [14] => 4
    [15] => 6
)
8 Answers

My solution to get the higher key is as follows:

max(array_keys($values['Users']));
Related