So, when I save the data into database, PHP will add a \ on single or double quote. That's is good.
However, when data passing back to client using json_encode(); TEXT like McDonald's is STORED as McDonald's in DB but once pass back from PHP to js, it will be encoded as McDonald\'s
Since I'm using jQuery, is there any plugin easily do that? or any function should I use to strip the slashes correctly? obviously, if there is case like \\s , the function should return as \s . :)
Sorry guys. I think I make my question more complicate. HOw about I make it simpler..
If I have a javascript avariable:
var abc = "McDonald\'s";
var bcd = "I need a slash \\ ";
var cde = "save the double quote \"";
how can I strip the \' ? what the regex I should use?