PHP » Arrays » min()

Syntax:
mixed min(array array)
mixed max(mixed no1, mixed no2 [, mixed no3, ...])
array
Array to be searched.
no1
Scalar to be searched.
no2
Scalar to be searched.
no3
Scalar to be searched.

Returns the minimum value.

The min() function works as max(), but returns the lowest value.

min() returns the element with the lowest numerical value in an array. Non-numerical strings count as 0. The parameters passed to the function can be either an array or at least two scalars.

Examples

Code:
<?php

print min(array("1500", 34.3, 4)) . " ";
print min("hello world", 33, 2.3);

?>
Output:
4 hello world
Explanation:

This example demonstrates the use of array and scalar parameters, and the evaluation of strings.

See Also: