// this code is from PRogrammerRimon, Email: nwscience98@gmail.com; date: 25-04-2022
$numbers = [1, 3,44,5,66,78,33];
$max = 0;
foreach ($numbers as $v) {
if($max < $v) {
$max = $v;
}
}
echo $max;
<?php
$array = array(5,7,81,0,12);
$max1 =0 ;
$max2 = 0;
for($i=0; $i $max1)
{
$max2 = $max1;
$max1 = $array[$i];
}
else if($array[$i] > $max2)
{
$max2 = $array[$i];
}
}
echo "Maximum value = ".$max1;
echo "
";
echo "Second maximum Value =".$max2;
?>