How to get the maximum subscript of an array in PHP, get the maximum subscript of an array
The example in this article describes the method of getting the maximum subscript of an array in PHP. Share it with everyone for your reference. The specific implementation method is as follows:
<?php
$hots = array('8213'=> 0,'8212'=> 100,'8172'=> 10008);
$key = array_search(max($hots),$hots);
echo $key;
?>
Copy after login
The running result is: 8172
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/998561.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/998561.htmlTechArticleHow to get the maximum subscript of an array in PHP. Get the maximum subscript of an array. This example describes how to get the maximum value of an array in PHP. Subscript method. Share it with everyone for your reference. Specific implementation method...