Home >Backend Development >PHP Tutorial >How to get the maximum subscript of an array in PHP, get the maximum subscript of an array_PHP tutorial

How to get the maximum subscript of an array in PHP, get the maximum subscript of an array_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:54:131539browse

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:

<&#63;php
$hots = array('8213'=> 0,'8212'=> 100,'8172'=> 10008);
$key = array_search(max($hots),$hots); 
echo $key;
&#63;>

The running result is: 8172

I hope this article will be helpful to everyone’s PHP programming design.

www.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