Jump to content
Sign in to follow this  
Krustbox

Question about If, and, or...

Recommended Posts

Krustbox

I had a quick question about how the if statement works. Say i want to do something like if $a=1 and ($b=2 OR $b=3). Would that statement as is work? Or would it need to be "if $a=1 and $b=2 OR $a=1 and $b=3"?

In other words, when trying to use BOTH "and" as well as "or" in the same if statement, what is the proper way to break it down and lay it out? Is there a nice and short way of doing it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.