note 85259 deleted from function.array-search by tularis

From: Date: Fri, 22 Aug 2008 15:07:21 +0000
Subject: note 85259 deleted from function.array-search by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-143748@lists.php.net to get a copy of this message
Note Submitter: gries Reason: useless ---- Hey, never forget to read the manual -.-. if you use array_search dont try to use: <?php if(!array_search("findme",$array)) ?> THIS WILL NOT WORK. because if you have an array like this: <?php Array( [0] => uid, [1] => givenName, [2] => sn, [3] => cn ); ?> array search like this: <?php array_search("uid",$array); ?> will return false because 0 is returned you have to check the return value like this <?php if(array_search("uid",$array)===false) ?>

« previous php.notes (#143748) next »