note 31135 added to function.array-walk
| From: | webwurst at rack1 dot php dot net | Date: | Thu, 10 Apr 2003 20:48:36 +0000 |
| Subject: | note 31135 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46465@lists.php.net to get a copy of this message | ||
this function works an given array recursivly, even with passing the values per reference. (but no
[, mixed userdata])
function array_walk_recursiv(&$array, $function)
{
foreach ($array as $key => $value)
{
if (is_array($value)) array_walk_recursiv($value, $function);
else $function($value, $key);
$array[$key] = $value;
}
}
--
http://www.php.net/manual/en/function.array-walk.php
http://master.php.net/manage/user-notes.php?action=edit+31135
http://master.php.net/manage/user-notes.php?action=delete+31135
http://master.php.net/manage/user-notes.php?action=reject+31135