469,312 Members | 2,503 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,312 developers. It's quick & easy.

opposite of isset

tolkienarda
316 100+
hi all

i have an if statement but i need to use the oppsite of isset like isn'tset only i know that isn't right is it like !isset or isset! or somthing totaly different

eric
Feb 20 '07 #1
4 14852
The1corrupted
134 100+
Perhaps you could try this...

[PHP]
if (isset($var)) {

Do what you don't want to do here...

} else {
Do what you want here
}[/PHP]
Feb 20 '07 #2
ronverdonk
4,258 Expert 4TB
The isset() function returns a boolean. So it is either true or false.

When you test using if (isset(xxx)) your action is performed on the true result of the isset.
When you test using if (!isset(xxx)) your action follows the true result of the NOT isset.

Hope this is clear. So the answer is: test with !isset(xx)

Ronald :cool:
Feb 20 '07 #3
tolkienarda
316 100+
thanks that was very clear

eric
Feb 20 '07 #4
ronverdonk
4,258 Expert 4TB
As ever: you are welcome.

Ronald :cool:
Feb 20 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by christian9997 | last post: by
9 posts views Thread by wouter | last post: by
2 posts views Thread by sathyashrayan | last post: by
2 posts views Thread by yawnmoth | last post: by
8 posts views Thread by Giovanni R. | last post: by
9 posts views Thread by arundelo | last post: by
8 posts views Thread by Simon Dean | last post: by
10 posts views Thread by major | last post: by
reply views Thread by Michael Fesser | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.