Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[PHP] if (this but not that)

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
leke
LXF regular


Joined: Mon Oct 22, 2007 6:45 pm
Posts: 500
Location: Oulu, Finland

PostPosted: Thu Apr 14, 2011 5:26 pm    Post subject: [PHP] if (this but not that) Reply with quote

I'm having some kind of mental block (blames PHP) and can't think how to test true for something and false for something else.

maybe like:
if (value1 == true && value2 == false) {run code;}

...or am I going about it the wrong way?
_________________
I codes here: http://notsure.cz.cc/
Back to top
View user's profile Send private message
bobthebob1234
LXF regular


Joined: Thu Jan 03, 2008 9:38 pm
Posts: 1368
Location: A hole in a field

PostPosted: Thu Apr 14, 2011 5:57 pm    Post subject: Reply with quote

if(value1 && !value2) {

}

??
_________________
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
Back to top
View user's profile Send private message
leke
LXF regular


Joined: Mon Oct 22, 2007 6:45 pm
Posts: 500
Location: Oulu, Finland

PostPosted: Thu Apr 14, 2011 7:03 pm    Post subject: Reply with quote

Thanks Bob, and now that my brain is working again, I realised I should have searched the manual for boolean -- but that didn't occur to me at the time Embarassed
_________________
I codes here: http://notsure.cz.cc/
Back to top
View user's profile Send private message
bobthebob1234
LXF regular


Joined: Thu Jan 03, 2008 9:38 pm
Posts: 1368
Location: A hole in a field

PostPosted: Thu Apr 14, 2011 8:39 pm    Post subject: Reply with quote

Happens to the best of us Very Happy
_________________
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast