Re: Strip Everything But Letters and Numbers?

From: Date: Wed, 15 Sep 2004 23:58:14 +0000
Subject: Re: Strip Everything But Letters and Numbers?
Groups: php.general 
Request: Send a blank email to php-general+get-196808@lists.php.net to get a copy of this message
i think with perl regs.. as preg_replace is, you can just use a shortcut command.. \w is any word char, \d is any digit.. im not sure it will improve this solution any, but its something else :P Jason Marek Kilimajer <lists@kilimajer.net> wrote: > > 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. > > Jeff > > > > $string = preg_replace('/[^a-z0-9]/i', '', $string); > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#196808) next »