function findMinMax($arr) {
$min = min($arr);
$max = max($arr);
return ["min" => $min, "max" => $max];
}
// Example usage:
$array = [3, 7, 2, 9, 1, 6];
$result = findMinMax($array);
echo "Minimum value: " . $result["min"] . ", Maximum value: " . $result["max"];
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Subscribe
Login
0 Comments
Oldest