note 102147 added to function.in-array
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 29 Jan 2011 20:01:27 +0000 |
| Subject: | note 102147 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176496@lists.php.net to get a copy of this message | ||
Here is a function that returns true if the element is in a multi-array.
function in_multiarray($elem, $array){
foreach($array as $item){
if($item == $elem){
return true;
exit;
}elseif(is_array($item)){
if(in_multiarray($elem, $item)){
return true;
exit;
}
}
}
return false;
}
Tried the followings comments and it did not work:
cousinka at gmail dot com 09-Aug-2010 12:44
bogdan AT bogdanconstantinescu DOT com 21-Apr-2010 03:01
----
Server IP: 69.147.83.197
Probable Submitter: 92.147.124.221
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/102147
Del: integrated -- https://master.php.net/note/delete/102147/integrated
Del: useless -- https://master.php.net/note/delete/102147/useless
Del: bad code -- https://master.php.net/note/delete/102147/bad+code
Del: spam -- https://master.php.net/note/delete/102147/spam
Del: non-english -- https://master.php.net/note/delete/102147/non-english
Del: in docs -- https://master.php.net/note/delete/102147/in+docs
Del: other reasons-- https://master.php.net/note/delete/102147
Reject -- https://master.php.net/note/reject/102147
Search -- https://master.php.net/manage/user-notes.php