RE: [PHP] is_alpha_numeric ?
| From: | John Monfort | Date: | Sat, 07 Jul 2001 15:59:29 +0000 |
| Subject: | RE: [PHP] is_alpha_numeric ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56643@lists.php.net to get a copy of this message | ||
I tried that, but it didn't work.
if (ctype_alnum($var)) {
echo "ok";
}else {
echo "no";
}
I got an 'undefined function' error.
php4.0.4pl1
Did I miss something ?
-john
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
On Sat, 7 Jul 2001, PHPBeginner.com wrote:
> check out ctype (suggested to PHP by me, btw)
>
> php.net/ctype
>
> we have all that.
>
> -Maxim Maletsky
>
>
>
>
> -----Original Message-----
> From: Lasse [mailto:lm@nospam.dk]
> Sent: Saturday, July 07, 2001 7:40 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] is_alpha_numeric ?
>
>
>
> "scott [gts]" <scott@graphictype.com> wrote in message
> news:KFEKLFMNHDILCMFAEKJCKEKJCMAA.scott@graphictype.com...
> > you could also use this:
> >
> > function is_alphanum($data) {
> > return preg_match('/^\w+$/', $data);
> > }
>
> Watch out though... IIRC \w also includes underscore...
>
> --
> Lasse
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>