valid_values = array_flip($valid_values);
$this->case_sensitive = $case_sensitive;
}
function validate($string) {
if (!$this->case_sensitive) {
$string = ctype_lower($string) ? $string : strtolower($string);
}
return isset($this->valid_values[$string]);
}
}
?>