Re: if($var) vs. if(isset($var))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux