note 106785 added to function.array-walk
| From: | manuscleatgmaildotcom at osu1 dot php dot net | Date: | Tue, 06 Dec 2011 15:16:53 +0000 |
| Subject: | note 106785 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184937@lists.php.net to get a copy of this message | ||
example with closures, checking and deleting value in array:
<?php
$array = array('foo' => 'bar', 'baz' => 'bat');
array_walk($array, function($val,$key) use(&$array){
if ($val == 'bar') {
unset($array[$key]);
}
});
var_dump($array);
----
Server IP: 89.31.146.176
Probable Submitter: 78.220.115.73
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- https://master.php.net/note/edit/106785
Del: integrated -- https://master.php.net/note/delete/106785/integrated
Del: useless -- https://master.php.net/note/delete/106785/useless
Del: bad code -- https://master.php.net/note/delete/106785/bad+code
Del: spam -- https://master.php.net/note/delete/106785/spam
Del: non-english -- https://master.php.net/note/delete/106785/non-english
Del: in docs -- https://master.php.net/note/delete/106785/in+docs
Del: other reasons-- https://master.php.net/note/delete/106785
Reject -- https://master.php.net/note/reject/106785
Search -- https://master.php.net/manage/user-notes.php