I'm having an issue with inserting JSON into a database, my intention is to take the variables, json_encode them, remove slashes (from magic_quotes), and then addslashes back in to escape the quotes in {"key":"value"}
Unfortunately, strip_slashes on the encoded string isn't doing anything, and outputs this
{"content":"<p>This string has it\'s downsides</p>","date":1271352514}
I have then tried addslashes, and mysql_real_escape_string, both output
"{\\"content\\":\\"<p>This string has it\\\'s downsides</p>\\",\\"date\\":1271352514}"
I can't work out why it's adding in two slashes? And I'm tearing my hair out over this, everytime I try to stripslashes it leaves one in, and adding slashes adds two. Any help would be hugely appreciated!