note 47261 deleted from function.in-array by tomsommer

From: Date: Tue, 09 Nov 2004 00:07:15 +0000
Subject: note 47261 deleted from function.in-array by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80305@lists.php.net to get a copy of this message
Note Submitter: darkspectrum at gmail dot com ---- I couldn't seem to find any function that would only return true if every value in the needle array was found in the haystack. So here is what I came up with... <? function ArrayIsInArray($needle, $haystack) { foreach ($needle as $nee) { if (in_array($nee,$haystack)) $inarray[] = true; } if (sizeof($inarray) == sizeof($needle)) return true; else return false; } ?>

« previous php.notes (#80305) next »