note 105317 added to control-structures.if
| From: | hiddenfun at mail dot ru | Date: | Tue, 09 Aug 2011 09:27:08 +0000 |
| Subject: | note 105317 added to control-structures.if | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182356@lists.php.net to get a copy of this message | ||
Be careful using if with different types of variables.
For example
$te=0;
if ($te=="string") echo "true"; else echo "false";
//will return true!
This occures because of type conversion.
"blablabla" == 0;
"3blablabla" ==3;
This moment is not really clear
----
Server IP: 69.147.83.197
Probable Submitter: 178.162.34.178
----
Manual Page -- http://www.php.net/manual/en/control-structures.if.php
Edit -- https://master.php.net/note/edit/105317
Del: integrated -- https://master.php.net/note/delete/105317/integrated
Del: useless -- https://master.php.net/note/delete/105317/useless
Del: bad code -- https://master.php.net/note/delete/105317/bad+code
Del: spam -- https://master.php.net/note/delete/105317/spam
Del: non-english -- https://master.php.net/note/delete/105317/non-english
Del: in docs -- https://master.php.net/note/delete/105317/in+docs
Del: other reasons-- https://master.php.net/note/delete/105317
Reject -- https://master.php.net/note/reject/105317
Search -- https://master.php.net/manage/user-notes.php