note 80380 modified in function.ctype-alnum by thiago
| From: | thiago@php.net | Date: | Tue, 28 Oct 2008 17:18:27 +0000 |
| Subject: | note 80380 modified in function.ctype-alnum by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145888@lists.php.net to get a copy of this message | ||
An alternative if you need to accept underscores as well:
if(eregi('[^a-zA-Z0-9_]', $str)){
$msg = 'Please enter an alphanumeric value';
)
--was--
Oops, above example should read:
if(eregi('[^a-zA-Z0-9_]', $str)){
$msg = 'Please enter an alphanumeric value';
)
http://php.net/manual/en/function.ctype-alnum.php