note 36798 added to function.array-sum
| From: | mucello at rn2 dot php dot net | Date: | Wed, 22 Oct 2003 19:44:51 +0000 |
| Subject: | note 36798 added to function.array-sum | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59147@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...
$average_of_foo = array_sum($foo) / count($foo);
----
Manual Page -- http://www.php.net/manual/en/function.array-sum.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36798
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36798&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36798&report=yes
Search -- http://master.php.net/manage/user-notes.php