View Full Version : if...else problem?

03-16-2009, 04:17 AM
How would you create an if...else statement that does something if one variable has one value or another value, but only those two? I know it would use the "||" operator, but I have no idea how it would be implemented.

This is probably really simple, but thanks.

03-16-2009, 04:26 AM
I think this is what you are asking:

if ($var == "1" || $var == "2")
//stuff to do if both are true

Give that a try.

03-16-2009, 04:30 AM
Yeah, thanks!