note 120107 added to function.array-walk-recursive
| From: | KH | Date: | Tue, 01 Nov 2016 17:43:51 +0000 |
| Subject: | note 120107 added to function.array-walk-recursive | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-207002@lists.php.net to get a copy of this message | ||
Example for the use of $userdata:
$userdata is the third parameter of the callback function.
The first parameter is $item, the second is $key, and the third one is $userdata.
<?php
$sweet = array('a' => 'Apfel', 'b' => 'Banane');
$fruits = array('süÃ' => $sweet, 'sauer' => 'Zitrone');
function test_print($item, $key, $info)
{
echo "$key beinhaltet $item $info\n";
}
array_walk_recursive($fruits, 'test_print', ' ... Bio');
?>
generates
a beinhaltet Apfel ... Bio
b beinhaltet Banane ... Bio
sauer beinhaltet Zitrone ... Bio
----
Server IP: 72.52.91.14
Probable Submitter: 129.233.4.251
----
Manual Page -- http://php.net/manual/en/function.array-walk-recursive.php
Edit -- https://master.php.net/note/edit/120107
Del: integrated -- https://master.php.net/note/delete/120107/integrated
Del: useless -- https://master.php.net/note/delete/120107/useless
Del: bad code -- https://master.php.net/note/delete/120107/bad+code
Del: spam -- https://master.php.net/note/delete/120107/spam
Del: non-english -- https://master.php.net/note/delete/120107/non-english
Del: in docs -- https://master.php.net/note/delete/120107/in+docs
Del: other reasons-- https://master.php.net/note/delete/120107
Reject -- https://master.php.net/note/reject/120107
Search -- https://master.php.net/manage/user-notes.php