note 41396 added to function.array-search

From: Date: Thu, 08 Apr 2004 15:02:43 +0000
Subject: note 41396 added to function.array-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-67825@lists.php.net to get a copy of this message
@@ apolion at loliart dot com: a thought to your example: the $key you get from your array_search is "0" (0 => 'blue'). And as for me, 0 ist the same as FALSE, so your if($key == false) hast to evaluate to true. after that, with the '===' -operand, you additionally compare the type of the variable and your statement evaluates to false, because 0 !== false. so everything seems to be okay for me. =) ---- Manual Page -- http://www.php.net/manual/en/function.array-search.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41396 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41396&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41396&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67825) next »