note 36798 modified in function.array-sum by vrana

From: Date: Tue, 17 Aug 2004 14:50:07 +0000
Subject: note 36798 modified in function.array-sum by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79725@lists.php.net to get a copy of this message
If you want to find the AVERAGE of the values in your array, use the sum and count functions together. For example, let's say your array is $foo and you want the average... <?php $average_of_foo = array_sum($foo) / count($foo); ?> --was-- If you want to find the AVERAGE of the values in your array, use the sum and count functions together. For example, let's say your array is $foo and you want the average... $average_of_foo = array_sum($foo) / count($foo); http://php.net/manual/en/function.array-sum.php

« previous php.notes (#79725) next »