Find the minimum value with the min() function:
<?phpecho(min(2,4,6,8,10) . "<br>");echo(min(22,14,68,18,15) . "<br>");echo(min( array(4,6,8,10)) . "<br>");echo(min(array(44,16,81,12)));?>The min() function returns the minimum value in an array, or the minimum value among several specified values.
min( array_values );ormin( value1,value2,... );
parameter | describe |
---|---|
array_values | Required. Specifies an array containing values. |
value1,value2,... | Required. Specifies the values to be compared (at least two values). |
Return value: | Numerical minimum. |
---|---|
Return type: | Mixed |
PHP version: | 4+ |