X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP min() Function

PHP Math Reference PHP Math Reference

Example

Find lowest value with the min() function:

<?php
echo(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)));
?>

Run example »

Definition and Usage

The min() function returns the lowest value in an array, or the lowest value of several specified values.


Syntax

min(array_values);

or

min(value1,value2,...);

Parameter Description
array_values Required. Specifies an array containing the values
value1,value2,... Required. Specifies the values to compare (must be at least two values)

Technical Details

Return Value: The numerically lowest value
Return Type: Mixed
PHP Version: 4+


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook