Php/func math max
来自菜鸟教程
PHP max()函数
例
使用max()函数查找最大值:
<?php echo(max(2,4,6,8,10) . "<br>"); echo(max(22,14,68,18,15) . "<br>"); echo(max(array(4,6,8,10)) . "<br>"); echo(max(array(44,16,81,12))); ?>
定义和用法
max()函数返回数组中的最大值,或几个指定值中的最大值。
句法
max(array_values); or max(value1,value2,...);
参数值
| 参数 | 描述 |
|---|---|
| array_values | 需要。指定一个包含值的数组 |
| value1,value2,... | 需要。指定要比较的值(必须至少为两个值) |
技术细节
| 返回值: | 数值最大值 |
| 返回类型: | 混合的 |
| PHP版本: | 4+ |