Skip to content

Instantly share code, notes, and snippets.



Created Nov 4, 2014
What would you like to do?
PHP array_average function
* Average an array
* I can't belive this isn't built in to PHP.
* @param float[] $array
* @return float
function array_average($array) {
return array_sum($array) / count($array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment