Re: Alphanumeric Strings
| From: | Lars Torben Wilson | Date: | Thu, 14 Sep 2000 22:31:17 +0000 |
| Subject: | Re: Alphanumeric Strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16849@lists.php.net to get a copy of this message | ||
Jason Granum writes:
> I can't seem to find the regex I'm looking for here. If anyone could
> point me in the right direction. I'm trying to see if a string
> contains ONLY alphanumeric characters. Is there an easy regex to
> find this out? Tnx
>
> --------------------------
> Jason Granum
if (ereg('[[:alnum:]]', $string)) {
/* do something */
}
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+