Monday, 2 September 2013

selected value on regular expression

selected value on regular expression

I'm having a problem with regular expression to validate user input. For
example
if(preg_match("/(male|female)/",$gender)==true)
{
echo "true";
}
When the user types anything after "male" or "female" my code still
outputs "true". How to solve this problem?

No comments:

Post a Comment