Please could someone tell me the best way to wrtite this in PHP i am validating gender in a text box i do not want to use radio button. at present my code is like this but not working
if(preg_match("/gender/i",$field))
{
if(!preg_match("/^M,F $/",$value))
{
$errors[] = "$value is not a valid gender.";
}
}
Could some tell me how to make sure value is either M OR F user inputed in box