note 59227 added to function.array-reduce
| From: | ildar | Date: | Wed, 30 Nov 2005 06:02:11 +0000 |
| Subject: | note 59227 added to function.array-reduce | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99339@lists.php.net to get a copy of this message | ||
in rare cases when an array is a set of numeric values and result is one of sum or product of
numbers the next examples may be useful
<?php
// sum of array items
echo eval('return ' . implode('+', $nums) . ';');
// product of array items
echo eval('return ' . implode('*', $nums) . ';');
?>
the reason of these codes is omitting of single used per script of callbacks
----
Manual Page -- http://www.php.net/manual/en/function.array-reduce.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59227
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59227&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59227&report=yes
Search -- http://master.php.net/manage/user-notes.php