Newbie pattern question
| From: | Phpu | Date: | Fri, 05 Nov 2004 18:55:00 +0000 |
| Subject: | Newbie pattern question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201301@lists.php.net to get a copy of this message | ||
Hi,
I have this function
function validate_name($name) {
if(ereg("^[a-zA-Z0-9_]{2,30}$", $name)) {
return true;
} else {
return false;
}
}
If i enter a name like John for exemple everything is ok but if i enter John Doe the function return
false.
Where is the problem?
Thanks