$maxValue = $resultArr[0];
foreach($searchArr as $val) {
//check for all the values for maximum value and compare it with default value
if($val["total_points"] > $maxPoint) {
$maxPoint = $val["total_points"];
}
}
echo "Maximum value is:".$maxValue;
?>
//Similarly minimum value in an array can also be found just by changing the if condition
No comments:
Post a Comment