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

December 2017
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031