PHP min() function with example

 16 - Mar - 2022
 XpertPhp
 43

In this article, We will explain to you PHP min() function with example.

PHP min() function

The min() function is a built-in function of PHP. which is used to returns the number with the lowest value of two specified numbers. so you can see our PHP math Function example.

Syntax

min(array_values);
or
min(value1,value2,...);

Example

<?PHP
echo min(20,10,30,40);
echo "
";
echo min(array(20,10,30,40));
?>

Output

10
10

Reference: PHP min() function