Re: replacing chars in input
| From: | Michal Migurski | Date: | Tue, 23 Mar 2004 17:10:59 +0000 |
| Subject: | Re: replacing chars in input | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181282@lists.php.net to get a copy of this message | ||
>I want to end up with
>
> A-Za-z0-9_-
>
>(letters, numbers, underscore and dash).
>
>If there isn't a handy character class waiting for me, what must I do to
>get those chars replaced?
$out = preg_replace('/\W+/', '', $in);
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html