special character replace with space..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
varma457
Forum Newbie
Posts: 23
Joined: Sat Jul 11, 2009 2:43 pm

special character replace with space..

Post by varma457 »

Hi,


I have a problem with wich I have to replace special character with space...

I tried it for removing special characters..

$output = preg_replace("/[^A-N\s?\*\&P-Y\s?\*\&a-z\s?\*\&]/"," ",$input);

But i dont how to replace with spaces...
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: special character replace with space..

Post by jackpf »

How is anyone going to be able to tell you unless you state what the "special character" is?

Do you mean anything that isn't a-z?
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: special character replace with space..

Post by prometheuzz »

jackpf wrote:How is anyone going to be able to tell you unless you state what the "special character" is?

...
My thoughts exactly, although I wouldn't use all the distracting colors.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: special character replace with space..

Post by jackpf »

Oh...I thought that was the theme of this thread :D
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: special character replace with space..

Post by prometheuzz »

jackpf wrote:Oh...I thought that was the theme of this thread :D
Cr@p! Sorry Jack, I'm just awfully slow today. It didn't even occur to me that your colourful post might be a reaction to the OP's post...
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: special character replace with space..

Post by jackpf »

:D
Post Reply