note 88521 deleted from function.in-array by danbrown

From: Date: Mon, 08 Jun 2009 21:37:44 +0000
Subject: note 88521 deleted from function.in-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156489@lists.php.net to get a copy of this message
Note Submitter: nensa at zeec dot biz ---- If you have to check very often (e.g. in a loop) against $haystack this one is much faster: $flipped_haystack = array_flip($haystack); [LOOP] if (isset($flipped_haystack[$needle])) ... [END LOOP]

« previous php.notes (#156489) next »