note 34535 added to function.array-sum
| From: | drverieevil at REMOVEMEasenne dot org | Date: | Wed, 30 Jul 2003 08:14:29 +0000 |
| Subject: | note 34535 added to function.array-sum | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52992@lists.php.net to get a copy of this message | ||
If some array elements arent integers, function will change them to integers (content of array will
not change) type and then sum them.
Example:
<?php
$foo[] = "12";
$foo[] = 10;
$foo[] = "bar";
$foo[] = "summer";
echo array_sum ($foo); //same as echo "22";
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-sum.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34535
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34535&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34535&report=yes