<?php
$temperature = array(78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76, 73, 68, 62, 73, 72, 65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 73);
$total = 0;
$len = count($temperature);
echo $len;
foreach($temperature as $temp) {
$total += $temp;
}
$avg = $total/$len;
echo "Averaage temp is" .$avg;
sort($temperature);
for ($i = 0; $i < 5 ; $i++) {
echo $temperatue[$i];
}
?>
preferences:
41.84 ms | 402 KiB | 5 Q