Forum Moderators: coopster
At the moment I'm doing this:
<?php if ($variable=="abc" OR $variable=="def" OR $variable=="ghi" OR $variable=="jkl")
echo "text";?> Is there a better way?
$variable = "abc";
$valid_values = array("abc", "def", "ghi", "jkl");
if (in_array($variable, $valid_values)) {
print 'Valid';
} else {
print 'Invalid';
}