Hi,
This is probably really simple but I cant get it working.
How do I write an if condition like this:
if($bet == "one" OR $calc == "two") { ... }
Thanks in advance, Martin
Errr - use the right "or" operator and use some brackets for clarity I would say.
i.e.
if (($bet == "one") || ($calc == "two"))
Says that if $bet equals "one" or $calc equals "two" then go into the condition
cheers...I knew it was something that simple.
actually, you had it right the first time:
if($bet == "one" or $calc == "two") { ... }
nope the || are correct separators, i use them in my nifty scripts :p
perhaps you should reread the manual chapter on logical operators again:
&& == and || == or
True - it shoud of worked before, but unless your a vb developer || is more of a standard.
Aslo - his if needed tidying up - brackets etc may not change the way it works, but make it a hell of a lot easier to read.
There is difference between OR and ||: http://www.php.net/manual/en/language.operators.php#language.operators.precedence