note 60721 added to function.in-array
| From: | com dot hotmail at backglancer | Date: | Sun, 15 Jan 2006 04:20:45 +0000 |
| Subject: | note 60721 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101777@lists.php.net to get a copy of this message | ||
correction to the function below, the second return is bogous
here's my tweaked version
<?PHP
function in_arrayr($needle, $haystack) {
foreach ($haystack as $value) {
if ($needle == $value) return true;
elseif (is_array($value)) in_arrayr($needle, $value);
}
return false;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60721
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60721&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60721&report=yes
Search -- http://master.php.net/manage/user-notes.php