...

View Full Version : Php If Or Statement



jussa
04-28-2006, 02:28 AM
if statement...

how do i say... if $a = "a" OR $b = "b"

in php??

Thanks, Justin

zactanaz
04-28-2006, 02:35 AM
if ($a == "a" or $b == "b")

Nightfire
04-28-2006, 03:02 AM
You can also use the 'pipelines'.



if ($a == "a" || $b == "b")

jussa
04-28-2006, 03:03 AM
ok guys, thanks heaps...but it turns out that didn't work... :eek: i had to use Xor .... :confused:

Craig82
11-17-2009, 09:31 AM
I know it's an old thread but this thread comes up in a Google search and just incase someone has problems with this, this way works:


if (($a=="a") || ($b=="b")){
//blah blah...
}

:thumbsup:

jbird123
09-22-2011, 10:18 AM
I know it's an old thread but this thread comes up in a Google search and just incase someone has problems with this, this way works:


if (($a=="a") || ($b=="b")){
//blah blah...
}

:thumbsup:

Thanks, did indeed some up with a google search! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum