note 20822 deleted from function.array-search by felipe

From: Date: Sun, 10 Feb 2008 13:11:56 +0000
Subject: note 20822 deleted from function.array-search by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-135970@lists.php.net to get a copy of this message
Note Submitter: moz at the-allens dot net ---- To future proof against the 4.2.0 return change something like this should work: <?php $key = array_search($needle, $haystack); if(is_null($key)) $retval = false; ?> and then test using: <?php if($key !== false) { // $key exists in $haystack. } ?>

« previous php.notes (#135970) next »