brandone Posted July 23, 2008 Share Posted July 23, 2008 I have an associative array with locations and corresponding numbers. I want to retrieve the maximum number in the array and its corresponding location. How can I do this? Link to comment https://forums.phpfreaks.com/topic/116268-max-on-an-associative-array/ Share on other sites More sharing options...
DarkWater Posted July 23, 2008 Share Posted July 23, 2008 How is the array formatted? Please post the output of print_r(). Link to comment https://forums.phpfreaks.com/topic/116268-max-on-an-associative-array/#findComment-597838 Share on other sites More sharing options...
brandone Posted July 23, 2008 Author Share Posted July 23, 2008 [0] => Arizona [1] => Central Florida [2] => Cleveland [3] => Hampton Roads [4] => Greater Louisiana [5] => Gulf Coast [6] => Kansas [7] => Las Vegas [8] => Middle Georgia [9] => New England [10] => New Orleans [11] => Northern Virginia [12] => Oklahoma [13] => Orange County [14] => Omaha [15] => Roanoke [16] => Tulsa [17] => San Diego [18] => Santa Barbara [19] => Corporate-Atlanta ) [data] => Array ( [0] => 2 [1] => 4 [2] => 2 [3] => 70 [4] => 21 [5] => 9 [6] => 10 [7] => 17 [8] => 1 [9] => 1 [10] => [11] => [12] => 90 [13] => 38 [14] => 6 [15] => 6 [16] => 32 [17] => [18] => 7 [19] => 3 ) So I am trying to find a way to put "Oklahoma 90" into a $variable. Link to comment https://forums.phpfreaks.com/topic/116268-max-on-an-associative-array/#findComment-597842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.