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

June 2017
M T W T F S S
« Jul    
 1234
567891011
12131415161718
19202122232425
2627282930