Get average number with PHP
<?php
//put all integer in array
$array = array(9,18,9,5,6,45);//Calculate the average.
$average = array_sum($array) / count($array);//Print out the average.
echo $average;//Round off to next greatest number
echo ceil($average);//round off to next smallest number
echo floor($average);?>
- Read more about Get average number with PHP
- Add new comment