Timeline for PHP Get Highest Value from Array
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 22, 2019 at 13:54 | comment | added | anoldermark | you know the max value, so loop through array to get matching IDs | |
Apr 25, 2019 at 17:03 | comment | added | anoldermark | max($array) is not going to work if two keys have the same max value. | |
Nov 13, 2018 at 17:00 | comment | added | COil |
Why not array_max() dear php. 🤔 Note that this function will not return an int if your values are of the string type. (even if they contain integers). So best to do $value = (int) max($array);
|
|
May 16, 2015 at 11:10 | vote | accept | Jamie McElwain | ||
Jul 13, 2011 at 9:31 | history | answered | Karoly Horvath | CC BY-SA 3.0 |