Re: if($var) vs. if(isset($var))
| From: | John Nichel | Date: | Tue, 23 Nov 2004 14:00:18 +0000 |
| Subject: | Re: if($var) vs. if(isset($var)) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202723@lists.php.net to get a copy of this message | ||
Sam Smith wrote:
What's the difference between: if($var) and if(isset($var))First is checking if $var is true (1, true, has value) or false (0, false, null, not set, etc.). Second is checking if $var has been defined, regardless of value. Depending on your error reporting level, the first one will throw a notice if $var has not been defined. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com