求助: PHP 数组获得最大值
当前变量的返回数据如下array(1){
[
"hostlist"
]=>array(1){
[
"hh-yun-ceph-cinder015-128055.vclound.com"
]=>array(1){
[
"net.if.in"
]=>array(6){
[
0
]=>string(8)"29408880"[
1
]=>string(8)"38533912"[
2
]=>string(8)"38106808"[
3
]=>string(8)"38263176"[
4
]=>string(8)"39617752"[
5
]=>string(8)"36451976"
}
}
}
我如何可以获得当前的最大值呢?
像你这种没什么好路子
先初始化max=item1
然后一个遍历foreach one item do
if current max less item
then do set new max
页:
[1]