array_search

From: Date: Tue, 26 Feb 2002 09:29:53 +0000
Subject: array_search
Groups: php.general 
Request: Send a blank email to php-general+get-86205@lists.php.net to get a copy of this message
Hi, Can anybody explain why the output of this script is not found Found! Here is the script... $legalfields = array("reasonForRepair"); if (array_search("reasonForRepair", $legalfields) == TRUE) {
    echo "Found!<br>";
} else {
    echo "not found<br>";
} $legalfields = array("foo", "reasonForRepair"); if (array_search("reasonForRepair", $legalfields) == TRUE) {
    echo "Found!";
} else {
    echo "not found";
} ?> Thanks in advance, Roger

« previous php.general (#86205) next »