Computing an array’s average

Needing to calculate an array’s (composed of numeric values) average, I used the following function:

1 2 3 4 function array_average($a) { return array_sum($a) / sizeof($a); }

Categories

Archives

Calendar

October 2017
M T W T F S S
« Jul    
 1
2345678
9101112131415
16171819202122
23242526272829
3031