Jump to content

Question about If, and, or...


Krustbox
 Share

Recommended Posts

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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...