PHP max() Function

The max() function returns the highest value in an array, or the highest value of several specified values.

mixed max ( array $values )
mixed max ( mixed $value1 , mixed $value2 [, mixed $... ] )

If the first and only parameter is an array, max() returns the highest value in that array. If at least two parameters are provided, max() returns the biggest of these values.

Example -

ParameterDescription
valuesAn array containing the values.
value1Any comparable value.
value2Any comparable value.
...Any comparable value.

Return Values

max() returns the parameter value considered "highest" according to standard comparisons. If multiple values of different types evaluate as equal (e.g. 0 and 'abc') the first provided to the function will be returned.