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

August 2017
M T W T F S S
« Jul    
 123456
78910111213
14151617181920
21222324252627
28293031