PHP获取数组最大值下标的方法
这篇文章主要介绍了PHP获取数组最大值下标的方法,涉及php中max及array_search等函数操作数组的相关技巧,需要的朋友可以参考下
本文实例讲述了PHP获取数组最大值下标的方法。分享给大家供大家参考。具体实现方法如下:
?
1 2 3 4 5 |
$hots = array('8213'=> 0,'8212'=> 100,'8172'=> 10008); $key = array_search(max($hots),$hots); echo $key; ?> |
运行结果为:8172
希望本文所述对大家的php程序设计有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6
Visual web development tools