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;
?>
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...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn