Skip to main content

max

Discworld driver help

max

Name

max() - Find the largest element of an array

Synopsis

mixed max( mixed *arr, int flag )

Description

max() finds the largest element of an array of ints, floats or strings. If `flag' is omitted or 0, the value of the largest element is returned, otherwise the index of the largest element is returned. Trying to find the largest element of an empty or inhomogeneous array will cause a runtime error.

It should not be confused with MAX(), which is a macro and only compares two values.

See also

min(), sort_array(), member_array()