note 96823 deleted from function.array-walk by danbrown
| From: | danbrown@php.net | Date: | Fri, 19 Mar 2010 15:32:55 +0000 |
| Subject: | note 96823 deleted from function.array-walk by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167216@lists.php.net to get a copy of this message | ||
Note Submitter: tchernoben at gmail dot com
----
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