Re: Removing special chars

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gerry Danen wrote:
I would like to replace all chars in a string that are not a-z or 0-9
with a space. I can use a series of str_replace functions, but there
has to be a faster way.

I know there is a solution but my chemo-brain is slowing me down today. Sorry...

Any suggestions?

TIA

Gerry

Not sure which would be easier or faster - but str_replace can take an array (black list approach) , or use preg_replace so you can do a white list approach.

--

life is a game... so have fun.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux