Interview common question asks about the array. Find the highest value from the array.
<?php
$arrs = [12,32,43,22,53,89];
$max = 0;
foreach($arrs as $arr){
if($arr > $max){
// Take single value from array and check if value is greather than $max value and if true it will assign to $max
$max = $arr;
}
}
echo "The highest value in array is : " . $max;
//Output : The higest value in array is : 89
?>