The max() function returns the highest value in an array


Syntax:

max(value1,value2,...);

example:

<?php
$num1 = 3;
$num2 = 9;
$num3 = 5;
$maxVal = max($num1,$num2,$num3);
echo $maxVal;//9
?>

output:

9