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.
精彩评论