Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-28-2006, 01:28 AM   PM User | #1
jussa
Regular Coder

 
Join Date: Mar 2006
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
jussa is an unknown quantity at this point
Php If Or Statement

if statement...

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

in php??

Thanks, Justin
jussa is offline   Reply With Quote
Old 04-28-2006, 01:35 AM   PM User | #2
zactanaz
New Coder

 
Join Date: Apr 2006
Location: Planet Earth
Posts: 59
Thanks: 1
Thanked 8 Times in 8 Posts
zactanaz is an unknown quantity at this point
PHP Code:
if ($a == "a" or $b == "b"
zactanaz is offline   Reply With Quote
Old 04-28-2006, 02:02 AM   PM User | #3
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
You can also use the 'pipelines'.

PHP Code:
if ($a == "a" || $b == "b"
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 04-28-2006, 02:03 AM   PM User | #4
jussa
Regular Coder

 
Join Date: Mar 2006
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
jussa is an unknown quantity at this point
ok guys, thanks heaps...but it turns out that didn't work... i had to use Xor ....
jussa is offline   Reply With Quote
Old 11-17-2009, 08:31 AM   PM User | #5
Craig82
New to the CF scene

 
Join Date: Sep 2009
Location: Slovenia
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Craig82 is an unknown quantity at this point
Arrow

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:

PHP Code:
if (($a=="a") || ($b=="b")){
//blah blah...

Craig82 is offline   Reply With Quote
Old 09-22-2011, 09:18 AM   PM User | #6
jbird123
New Coder

 
Join Date: Jan 2010
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
jbird123 is an unknown quantity at this point
Quote:
Originally Posted by Craig82 View Post
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:

PHP Code:
if (($a=="a") || ($b=="b")){
//blah blah...

Thanks, did indeed some up with a google search!
jbird123 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:39 AM.


Advertisement
Log in to turn off these ads.