title: Addslashes, mysql_real_escape always adding two slashes?
body: <p>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"}</p>
  
  <p>Unfortunately, strip_slashes on the encoded string isn't doing anything, and outputs this</p>
  
  <pre><code>{"content":"&lt;p&gt;This string has it\'s downsides&lt;/p&gt;","date":1271352514}
  </code></pre>
  
  <p>I have then tried addslashes, and mysql_real_escape_string, both output</p>
  
  <pre><code>"{\\"content\\":\\"&lt;p&gt;This string has it\\\'s downsides&lt;/p&gt;\\",\\"date\\":1271352514}"
  </code></pre>
  
  <p>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!</p>