John W. Holmes wrote:

To detect them:
if(preg_match('/[^0-9a-zA-Z]/',$string))
{ echo 'bad characters present'; }
else
{ echo 'string okay'; }

or (faster):

if (!ctype_alnum($string)){
    echo 'bad characters present';
} else {
    echo 'string okay';
}

Aaron

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to