What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » AND and OR

AND and OR
Author: Message:
leito
Senior Member
****

Avatar
Chameleon by KeyStorm

Posts: 720
Reputation: 5
38 / Male / –
Joined: Apr 2003
O.P. AND and OR
Hi, again! hahaha, I want to make something like this in PHP

if ( $a=yes OR ($b<=10 AND $c<=10) { etc.

Were, <= means "smaller or equal to"
and one condition is $a=yes
and the other conditions is $b<=10 AND $c<=10

I think this could be like...

if ($a=="yes" || ($b<="10" && $c<=10)) {

My question is can i group conditions using ()? Is <= the way you write "smaller or equal to"?

Thank you in advance for your help.
[Image: leonelgalan.png]
02-19-2004 04:47 AM
Profile E-Mail PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: AND and OR
quote:
Originally posted by leito.gt
My question is can i group conditions using ()?
Yes. The example you posted should work fine, though I'd remove the quotes around "10" as it's an integer, not a string.

quote:
Is <= the way you write "smaller or equal to"?
Yes. Technically it's called "less than or equal to." :p
02-19-2004 05:05 AM
Profile PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: AND and OR
Just in case you didn't know, by the way, if you want it to execute only of one of the two are true and not both, use XOR.
02-19-2004 07:44 PM
Profile E-Mail PM Web Find Quote Report
leito
Senior Member
****

Avatar
Chameleon by KeyStorm

Posts: 720
Reputation: 5
38 / Male / –
Joined: Apr 2003
O.P. RE: AND and OR
fluffy what does XOR means? what I want is that if one condition is true, "good to go" haha.

And WDZ thanks, for the "less than or equal to" hahaha, I learn something new!
[Image: leonelgalan.png]
02-19-2004 09:18 PM
Profile E-Mail PM Find Quote Report
Apatik
Full Member
***

Avatar
\o/

Posts: 431
Reputation: 12
– / Male / Flag
Joined: Nov 2003
Status: Away
RE: AND and OR
XOR is false if the two conditions are verified, true when one and only one of the two conditions is verified
[Image: rdmazu.php]
02-19-2004 10:16 PM
Profile PM Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: AND and OR
XOR: eXclusive OR: A XOR B: or A or B but not both at the same time ;)
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
02-19-2004 10:23 PM
Profile PM Find Quote Report
user2319
Disabled Account


Posts: 1779
Joined: Oct 2002
Status: Away
RE: AND and OR
he wants one of them to be true ;)

quote:
what I want is that if one condition is true, "good to go" haha.
02-20-2004 05:04 PM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: AND and OR
quote:
Originally posted by PlusFan
he wants one of them to be true
He didn't say "only one" though, and if two are true, that means one is true. :refuck:
02-20-2004 05:20 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On