September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed max(mixed arg1, [mixed arg2], [mixed ...])
Returns the highest value out of the values passed.
Returns:
Greatest value of arguments passed
Description:
max() returns the value of the numerically greatest of the arguments passed to it. If the first argument is an array, then the element of that array having the numerically greatest value will be returned. Alternatively, any number of arguments may be passed, in which case the greatest of them will be the result.
This function handles negative numbers correctly, in that negative numbers are considered greater the closer they are to zero. For instance -3 is greater than -4, -2.123 is greater than -2.345, and so on.
Version:
PHP 3, PHP 4
See also:
min()
Example:
Read now
Unlock full access