Chances are this is very simple to do but I just can't figure it out cause I'm a noob Say I have an if statement that says 'if $variable is equal to 1 then execute statement'. But what if I want to say 'if $variable is equal to 1 OR $variable is equal to 2 OR $variable is equal to 3 ... etc etc etc. All the way up to 20 lets say. How do I compare the variable to all these values without having to write an OR statement for every value?
www.php.net/in_array Or as you said: if ($foo == 'x' OR $foo == 'y' OR $foo == 'z' ...) PHP: EDIT; Forget the 2nd suggestion, I should read the whole message before replying.