This post is really prompted by the "shortcut for isset()?" thread and
many others similar to it:
In the case of POST/GET etc, isn't it a lot better to use If(empty($var)
instead of Isset? Isset will return true if there's so much as an empty
string there, where empty() would declare it to be False.
Isset is great for radio buttons, things along those lines, but not
if you want to be sure a name, address, etc. at least has been entered
in it.
But interestingly enough, I never see anyone do it that way; isset() is
always used, it seems.
Or am I missing something basic? I know I'm a neophyte, but ... empty()
just feels like a lot better choice than isset() in most forms, No?
TIA
Twayne
many others similar to it:
In the case of POST/GET etc, isn't it a lot better to use If(empty($var)
instead of Isset? Isset will return true if there's so much as an empty
string there, where empty() would declare it to be False.
Isset is great for radio buttons, things along those lines, but not
if you want to be sure a name, address, etc. at least has been entered
in it.
But interestingly enough, I never see anyone do it that way; isset() is
always used, it seems.
Or am I missing something basic? I know I'm a neophyte, but ... empty()
just feels like a lot better choice than isset() in most forms, No?
TIA
Twayne
Comment