...

View Full Version : if...else problem?



Jearb
03-16-2009, 03: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.

thesavior
03-16-2009, 03: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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum