note 67135 deleted from function.empty by bjori
| From: | bjori@php.net | Date: | Sat, 03 Jun 2006 20:21:33 +0000 |
| Subject: | note 67135 deleted from function.empty by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-113146@lists.php.net to get a copy of this message | ||
Note Submitter: cypher at inbox dot lv
Reason: in docs
----
I have noticed the following:
Let's say you have such URL: http://yourhost.com/index.php?myvar=0
which means $_GET["myvar"] = 0;
If you check myvar in such a way:
if (empty($_GET["myvar"]))
// do something
then it will evaluate as TRUE! although the value is '0'.
In order to make such a check work you must use isset:
if (!isset($_GET["myvar"]))
// do something
This evaluetes to FALSE