note 63151 added to function.in-array

From: Date: Tue, 14 Mar 2006 18:06:11 +0000
Subject: note 63151 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-105801@lists.php.net to get a copy of this message
This recursive search works well. I've tested some ones before and didn't work for me. This also checks that the types are the same. function in_arrayr($needle, $haystack){ foreach ($haystack as $v){ if (is_array($v)){ if(in_arrayr($needle, $v)) return true; } elseif($needle === $v) return true; } return false; } ---- Server IP: 130.206.1.5 Probable Submitter: 158.109.58.35 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- http://master.php.net/note/edit/63151 Del: integrated -- http://master.php.net/note/delete/63151/integrated Del: useless -- http://master.php.net/note/delete/63151/useless Del: bad code -- http://master.php.net/note/delete/63151/bad+code Del: spam -- http://master.php.net/note/delete/63151/spam Del: non-english -- http://master.php.net/note/delete/63151/non-english Del: in docs -- http://master.php.net/note/delete/63151/in+docs Del: other reasons-- http://master.php.net/note/delete/63151 Reject -- http://master.php.net/note/reject/63151 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#105801) next »