How would I code an if then statement like this:
if $variable1 = $this, $this, $this or $this then do this.
Basically, if variable1 = any one of these, then do this.
Any suggestions?
two ways
[man]if[/man]
if($variable1 == $this || $variable1 == $that || $variable1 == $something){ //do something }
or [man]switch[/man]
switch($variable1){ case $this: case $that: case $something: //do it here break; case default: //if it doesn't match the others, do this break; }
hope that helps
adam
Put all of those in an array. Just make it easier
$array = array("foo","bar","biz","baz"); if(in_array($variable1,$array)) { // do something }