note 96823 added to function.array-walk

From: Date: Wed, 17 Mar 2010 15:51:20 +0000
Subject: note 96823 added to function.array-walk
Groups: php.notes 
Request: Send a blank email to php-notes+get-167138@lists.php.net to get a copy of this message
If you're not affraid to have a deprecated error, here's a solution to use array_walk for mapping an array into another : <?php $a = range(1,5); function a ($a,$b,&$c) { $c[] = $a * 2; } $c = array(); array_walk($a, 'a', &$c); var_dump($c); var_dump($a); Enjoy ---- Server IP: 69.147.83.197 Probable Submitter: 194.5.73.1 ---- Manual Page -- http://www.php.net/manual/en/function.array-walk.php Edit -- https://master.php.net/note/edit/96823 Del: integrated -- https://master.php.net/note/delete/96823/integrated Del: useless -- https://master.php.net/note/delete/96823/useless Del: bad code -- https://master.php.net/note/delete/96823/bad+code Del: spam -- https://master.php.net/note/delete/96823/spam Del: non-english -- https://master.php.net/note/delete/96823/non-english Del: in docs -- https://master.php.net/note/delete/96823/in+docs Del: other reasons-- https://master.php.net/note/delete/96823 Reject -- https://master.php.net/note/reject/96823 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167138) next »