PHP min() - Math Functions

What is min Function?

Explanation

The "min()" function returns the lowest value among the two numbers given.

Syntax:


min(x,y)

In the above syntax "x","y" are the numbers to be compared to find the lowest value.

Example :


<?php
echo(max(4,8) . "<br />");
echo(max(-4,7) . "<br />");
echo(max(-2,-6) . "<br />");
echo(max(8.30,8.40))
?>
Result :

4
-4
-6
8.3

In the above example the lowest values among the numbers are displayed.

PHP Topics


Ask Questions

Ask Question