I would like to do an action if a variable exists in several different values - - without a lot of code.
A user on my site will be directed to a different action depending on what country they are from. Here is a sample of my present code:
if (($country=="AU"
OR ($country=="CL"
OR ($country=="NZ"
OR ($country=="NI"
OR ($country=="PA"
OR ($country=="PH"
OR ($country=="TT"
OR ($country=="UM"
OR ($country=="VI"
OR ($country=="BR"
OR ($country=="AR"
OR ($country=="BS"
OR ($country=="BB"
OR ($country=="BM"
) {
//then do this
}
Is there a simpler way of doing this without repeating so much code? I have a set of about 20 countries for each action (and there are several different action sets). To simplify the example above, I have not included all the countries I intend to use. The list will be much larger.
Thank you!
A user on my site will be directed to a different action depending on what country they are from. Here is a sample of my present code:
if (($country=="AU"
//then do this
}
Is there a simpler way of doing this without repeating so much code? I have a set of about 20 countries for each action (and there are several different action sets). To simplify the example above, I have not included all the countries I intend to use. The list will be much larger.
Thank you!