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
Now i need to find the highest value in the array which i know i can usePHP Code:$tally[c1] = 3;
$tally[r1] = 5;
$tally[ps] = 1;
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?PHP Code:max($tally) //Returns 5


Reply With Quote
Bookmarks