note 105177 deleted from function.in-array by danbrown

From: Date: Mon, 01 Aug 2011 16:25:37 +0000
Subject: note 105177 deleted from function.in-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182075@lists.php.net to get a copy of this message
Note Submitter: smreeder at gmail dot com ---- A variation on bogdan's in_multiarray, to allow for searching associative multidimensional arrays: function in_multiarray($needle, $haystack) { if(is_array($haystack)){ foreach($haystack as $key=>$value) { if(in_multiarray($needle, $value)) return true; } } else return $haystack == $needle; }

« previous php.notes (#182075) next »