note 34535 deleted from function.array-sum by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:51:20 +0000 |
| Subject: | note 34535 deleted from function.array-sum by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215355@lists.php.net to get a copy of this message | ||
Note Submitter: drverieevil at REMOVEMEasenne dot org
----
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";
?>