min

mixed min(mixed arg1, [mixed arg2], [mixed ...]) 

Returns the numerically lowest of a set of values.

Returns:

Lowest value of the arguments passed

Description:

min() returns the value of the numerically lowest of the arguments passed to it. If the first argument is an array, then the element of that array having the numerically lowest value will be returned. Alternatively, any number of arguments may be passed, in which case the lowest of them will be the result.

This function handles negative numbers correctly, in that negative numbers are considered smaller the further they are from zero. For instance -4 is less than -3, -2.345 is less than -2.123, and so on.

See also:

max() 

Example:

Get the minimum of a set of values
 $var1 = 12; $var2 ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.