Validating spaces in Form Input
| From: | jeff alerta | Date: | Thu, 02 Nov 2000 09:49:21 +0000 |
| Subject: | Validating spaces in Form Input | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23430@lists.php.net to get a copy of this message | ||
Hi All,
I am trying to validate Form INPUT to ensure that only alphanumeric
info is being entered.
I am using the following code to do it:
if(!eregi("^[[:alnum:]]+$", $string))
{
return(false);
}
The above code works fine with a single word string, however, with
input where there are spaces in the string (e.g. a street address), it
fails.
Does anyone know of a regular expression that will validate
alphanumeric strings with spaces?
Thanks in advance for any and all help.
jeff alerta
jalerta@nestworks.com