|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-02 07:15 UTC] judas dot iscariote at gmail dot com
[2006-11-08 14:09 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 12:00:01 2025 UTC |
Description: ------------ I've got a "GET variable" called $codArea in my script. Just before the if statement an echo on the variable would return me "asd" (just to test it, the normal would be integers btw). Inside the { } in the if structure, it also echo's "asd". The problem is, the statement which is returning TRUE (so the script goes inside de if brackets) is ' $codArea == 0 ' without the single quotes. Just look in the code and you'll understand. Not a type conversion misusage, I guess. Reproduce code: --------------- //script.php?area=asd on the address bar and on links $codArea = $_GET['area']; //Creating the "GET variable" echo $codArea; // returns "asd" if ($codArea == 0) { echo $codArea; // returns "asd" echo ($codArea == 0); // returns "1" } //All values are printed on the screen without the quotes Expected result: ---------------- asd Actual result: -------------- asd asd 1