note 106647 deleted from function.in-array by thiago
| From: | thiago@php.net | Date: | Thu, 24 Nov 2011 18:12:14 +0000 |
| Subject: | note 106647 deleted from function.in-array by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184661@lists.php.net to get a copy of this message | ||
Note Submitter: crazyone at crazycoders dot net
----
@beingmrkenny
It's normal that 'egg' matches your array because php is not strict in it's type
comparison. This is why you have a STRICT 3rd parameter to in_array().
In your original array you have TRUE as a value, true is equal to anything that is no 0, NULL or
''. Thus, comparing any non empty value to true always returns true.
Use the strict parameter to change that behavior.