PHP获取数组最大值下标的方法

<?php
$hots = array('8213'=> 0,'8212'=> 100,'8172'=> 10008);
$key = array_search(max($hots),$hots);
echo $key;
?>
 
运行结果为:8172
posted @ 2019-08-09 02:23  Bit5566  阅读(1713)  评论(0编辑  收藏  举报