views:

18

answers:

2

Hi, I am using jQuery editor with PHP it works fine for plane text (text with out special characters) but if I try to post text which contain special characters then it does not store these special characters in to db table.. and when I tried to replace any special character with HTML codes it works fine. But it is too difficult to replace all special character one by one.. Is there any script which replace all special characters from a string...?

Thanks

A: 

Do you mean something like PHP's str_replace()?
http://php.net/manual/en/function.str-replace.php

Michael C
A: 

Is there any script which replace all special characters from a string...?

This is the wrong approach. You need to get your character sets right, so will be no need to replace anything.

I don't know what you're doing, but if you are transmitting data through Ajax, it is probably UTF-8 encoded. If your database is in a different character set, you may need to convert it.

Pekka