|
Posted by Kimmo Laine on 08/29/05 15:35
"kerul4u" <kerul4u@gmail.com> wrote in message
news:1125318171.067211.108700@z14g2000cwz.googlegroups.com...
> Try this simple yet powerfull solution
>
> //Your String
> $string = "a&*bbb cc/c d!d";
>
> //Array of special charecters you want to replace
> $special = array('/','!','&','*'); //here you can add as many char. you
> want
> $replacements = "";
>
> echo str_replace($special,'',$string);
>
That still doesn't remove multiple spaces, ie. whitespace. Some regexp
wizard kid could tell how the whitespace is replaced with a single space.
I'd say that converting the spcial chars would be easy too with regular
expressions.
The thing is I'm all thumbs with regexp so I can only recommend using it but
I have no idea how it would work ;)
--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com
[Back to original message]
|