Skip to main content

min

Discworld driver help

min

Name

min() - Find the smallest element of an array

Synopsis

mixed min( mixed *arr, int flag )

Description

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

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

See also

max(), sort_array(), member_array()