471,852 Members | 984 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

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 16342
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 YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.