In PHP, you can use the max() function to query the maximum value in an array. This function can obtain the maximum value in an array and return it; the syntax format is "max(array)", and the parameter array is used to specify an Array containing values.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can use max () function queries the maximum value in an array.
max() function returns the maximum value in an array.
Syntax:
max(array);
array: Specifies an array containing values.
Example:
<?php $a=array('1','3','55','99'); echo max($a); ?>
Output:
99
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to query the maximum value in an array in php. For more information, please follow other related articles on the PHP Chinese website!