note 92249 added to function.array-reduce
| From: | Jonathan at osu1 dot php dot net | Date: | Wed, 15 Jul 2009 20:58:53 +0000 |
| Subject: | note 92249 added to function.array-reduce | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158352@lists.php.net to get a copy of this message | ||
@hrobky
Here is a more efficient way to "array_reduce using array_merge". I ran into this same
issue, and as the number of arguments increases, the foreach method progressively loses ground.
<?php
$result = call_user_func_array('array_merge', $arr);
?>
----
Server IP: 208.69.120.35
Probable Submitter: 152.14.19.197
----
Manual Page -- http://www.php.net/manual/en/function.array-reduce.php
Edit -- https://master.php.net/note/edit/92249
Del: integrated -- https://master.php.net/note/delete/92249/integrated
Del: useless -- https://master.php.net/note/delete/92249/useless
Del: bad code -- https://master.php.net/note/delete/92249/bad+code
Del: spam -- https://master.php.net/note/delete/92249/spam
Del: non-english -- https://master.php.net/note/delete/92249/non-english
Del: in docs -- https://master.php.net/note/delete/92249/in+docs
Del: other reasons-- https://master.php.net/note/delete/92249
Reject -- https://master.php.net/note/reject/92249
Search -- https://master.php.net/manage/user-notes.php