How to find the max or largest number from an Array


To find the max or largest number from an Array we need the use the predefined function max of PHP.

Only number is allowed in the array list.

Example

<!DOCTYPE html>
<html>
<body>

<?php
echo(max(45,4,6,8,10) . "<br>");
echo(max(22,14,68,18,15) . "<br>");
echo(max(array(4,6,12,10)) . "<br>");
echo(max(array(4200,1333,4577,12)));
?>

</body>
</html>