This article mainly introduces the method of getting the maximum subscript of an array in PHP, involving the operation of arrays by functions such as max and array_search in PHP Tips, friends in need can refer to it
The example in this article describes the method of obtaining the maximum subscript of an array in PHP. Share it with everyone for your reference. The specific implementation method is as follows:
?
2 3 4
|
$hots = array('8213'=> 0,'8212'=> 100,'8172'=> 10008); $key = array_search(max($hots),$hots); echo $key; ?> |