[PHP] Re: Valid Chars Function From: _lallous (elias_bachaalany <email protected>)
Date: 11/19/01

you can use regluar expressions, or single character scanning via for loop,

1)RegExp:
if (ereg('[^a-z0-9]', $name)) print 'error!';

2)For loop
for ($i=0;$i<strlen($name)$;$i++)
if ($name[$i] == '@' || $name[$i]=='!' .. ....) print 'error!';

"Phantom" <phantom <email protected>> wrote in message
news:3BF8B49C.40F54D45 <email protected>
> Anyone know a good PHP function or script to scan a string for Valid
> Characters to make sure something that is not allow is not included in a
> form?
>
> $Name = "#@@##@!#!@" would not be a valid alphabetical name, how do I
> scan for that in PHP? Thanks.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>