Checking a value within a list
Posted: Fri Dec 02, 2005 9:40 am
Hi
I am looking for a way in which I can check a variable is in a certain list of values.
What i am doing is taking a country then checkin whether it is in a certain group e.g. continent etc.
Now i know i can do this:
but i wondered whether there is a quicker way to achieve this in code
Thanks in advance
I am looking for a way in which I can check a variable is in a certain list of values.
What i am doing is taking a country then checkin whether it is in a certain group e.g. continent etc.
Now i know i can do this:
Code: Select all
if ($cn = UK || $cn = SP || $cn = FR || $cn =GER || ..etc.....
print ' European country';but i wondered whether there is a quicker way to achieve this in code
Thanks in advance