if() plain versus if(isset) and if(empty)
| From: | Adrian Greeman | Date: | Sun, 13 Apr 2003 21:44:57 +0000 |
| Subject: | if() plain versus if(isset) and if(empty) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143696@lists.php.net to get a copy of this message | ||
I am learning PHP. Can anyone help unconfuse me about the use of if() and
the use of isset and empty functions (with if()?
What is the difference between writing
if($Variable)
if(isset($variable))
if($Variable=="avalue")
if($Variable!="")
if(!empty($Variable)) etc etc
and are these various things affected when taking values via a superglobal?
eg if($_POST['variable'] versus if(isset($_POST['variable']))
And are there further issues when you are using if() with a complex
statement?
Regards
Adrian Greeman