note 72465 added to function.array-walk
| From: | "JonLangevin>>intel352":AT:gmail dot com at osu1 dot php dot net | Date: | Fri, 19 Jan 2007 20:15:22 +0000 |
| Subject: | note 72465 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121927@lists.php.net to get a copy of this message | ||
In response to "Andrzej Martynowicz at gmail dot com", regarding the use of array_walk
with the optional 3rd parameter being modified by reference:
while your solution works, yet another option is to call array_walk like so:
<?php
array_walk($array1, 'userfunction', &$array2byreference);
function userfunction(&$array1value, $key, $array2){
// process $array1value and $array2, $array2 will retain the values
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 216.48.9.145
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- https://master.php.net/note/edit/72465
Del: integrated -- https://master.php.net/note/delete/72465/integrated
Del: useless -- https://master.php.net/note/delete/72465/useless
Del: bad code -- https://master.php.net/note/delete/72465/bad+code
Del: spam -- https://master.php.net/note/delete/72465/spam
Del: non-english -- https://master.php.net/note/delete/72465/non-english
Del: in docs -- https://master.php.net/note/delete/72465/in+docs
Del: other reasons-- https://master.php.net/note/delete/72465
Reject -- https://master.php.net/note/reject/72465
Search -- https://master.php.net/manage/user-notes.php