Mega Code Archive
Categories
/
Php
/
Data Type
Finding the Sum and Average of the Values in an Array
8.5, 'Jan' => 9.8, 'Terry' => 8.0); printf("
There are %d scores, totaling %.2f and averaging %.2f.
", count($scores), array_sum($scores), array_average($scores)); ?>