开发者

json_encode() - how to get original data back?

I"m using the function json_encode() to encode my data in php before sending it back to my page. However, single quotes and double quotes have been escaped and appear as /' and /" in javascr开发者_如何学JAVAipt. Any idea how to get back those quotes without those slashes in javascript. I'm using jquery.


Use $.parseJSON() if your JSON is a string.

If after that, you still have slashes, you may have magic quotes on. Check with this...

var_dump(get_magic_quotes_gpc());

If you get TRUE, disable magic quotes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜