note 54520 added to function.array-map

From: Date: Wed, 06 Jul 2005 23:53:52 +0000
Subject: note 54520 added to function.array-map
Groups: php.notes 
Request: Send a blank email to php-notes+get-91559@lists.php.net to get a copy of this message
You can pass values to array_map by reference, essentially allowing you to use it as you would array_walk with multiple arrays as parameters. A trivial example: <?php $a = array(1,2,3,4,5); $add_func = create_function('&$x, $y', '$x+=$y;'); array_map($add_func, $a, $a); print_r($a); ?> Array ( [0] => 2 [1] => 4 [2] => 6 [3] => 8 [4] => 10 ) ---- Manual Page -- http://www.php.net/manual/en/function.array-map.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54520 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54520&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54520&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91559) next »