I have an assoc array in PHP which I am sorting by value. After sorting I need to return the key of the first element.
Example array:
Array
(
[a] => 42.857142857143
[b] => 87.5
[c] => 50
[d] => 61.538461538462
)
Then I use asort(), and the array looks like this:
Array
(
[b] => 87.5
[d] => 61.538461538462
[c] => 50
[a] => 42.857142857143
)
How can I return "b" (as it is the key of the first array)?