Hey, im searching for a function(if there is one) that will allow me to get the key of a value in an array. Basically i have an array that is like
$tally[c1] = 3;
$tally[r1] = 5;
$tally[ps] = 1;
Now i need to find the highest value in the array which i know i can use
max($tally) //Returns 5
However what i need to find is i need to get r1, not the 5. There is probally an easy way using max to find the key using another array function but i've yet to be able to figure it out, any suggestions?