PHP Min() and Max() functions
The PHP min() and max() functions can be used to find lowest or highest value in a list of arguments.
Max(): max() returns the parameter value considered “highest” according to standard comparisons. If multiple values of different types evaluate as equal (e.g. 0 and ‘abc’) the first provided to the function will be returned.
Min(): min() returns the parameter value considered “lowest” according to standard comparisons. If multiple values of different types evaluate as equal (e.g. 0 and ‘abc’) the first provided to the function will be returned. PHP min and max functions
Example
<!DOCTYPE html>
<html>
<head>
<title>PHP Min() and Max() Functions</title>
</head>
<body>
<h1> </h1>
<?php
<html>
<head>
<title>PHP Min() and Max() Functions</title>
</head>
<body>
<h1> </h1>
<?php
echo(min(0, 150, 30, 20, -8, -200));
echo "<br>";
echo(max(0, 150, 30, 20, -8, -200));
echo "<br>";
echo(max(0, 150, 30, 20, -8, -200));
?>
-200
150
OR
Example
<!DOCTYPE html>
<html>
<head>
<title>PHP Min() and Max() Functions</title>
</head>
<body>
<h1> </h1>
<?php
<html>
<head>
<title>PHP Min() and Max() Functions</title>
</head>
<body>
<h1> </h1>
<?php
$array = array(1, 2, 3, 4, 5);
echo(max($array));
echo("\n"); // for breakline
echo(min($array));
?>
</html>
5
1

Video on This Topic :- Soon
I hope you liked this post, then you should not forget to share this post at all.
Thank you so much :-)
0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.