Re: Strip Everything But Letters and Numbers?
| From: | John Holmes | Date: | Wed, 15 Sep 2004 23:55:30 +0000 |
| Subject: | Re: Strip Everything But Letters and Numbers? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196807@lists.php.net to get a copy of this message | ||
Jeff Oien wrote:
Is there an easy way to strip out everything but letters and numbers from a string? I tried searching the archives and didn't come up with much. Thanks.$fixed = preg_replace('/[^a-zA-Z0-9]/','',$text); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com