How do I check if multiple things are set, I am gettting really frustrated.
if (isset($var1 and $var2 and $var3)) {
do something cool
} else {
don't do something cool
}
do I use and? or commas or what.
| SitePoint Sponsor |
How do I check if multiple things are set, I am gettting really frustrated.
if (isset($var1 and $var2 and $var3)) {
do something cool
} else {
don't do something cool
}
do I use and? or commas or what.





Try:
if((isset($var1)) && (isset($var2)) && (isset($var3))) {
blah
Basically 'and' is replaced with '&&'
I think you can only do this on that way:
if (isset($var1) and isset($var2) and isset($var3)) {
do something cool
} else {
don't do something cool
}
But that's my first post here so anyone can correct me
Edit:
Ohhh I'm to slow for this Board![]()
Last edited by zap; May 3, 2001 at 11:41.
A German boy who wants to improve his PHP/MySQL knowledge in this Forum
Bookmarks