title: Escaping special characters
body: <p>Just a quick question. I want to send data from Javascript to a PHP script to store it in my database, then getting it back the same way (a script calls a PHP function, and data is sent back with JSON). </p>
  
  <p>Which function should I use in the javascript ? I should never need to get the data only with PHP, so is it ok to use <code>escape(string);</code> then <code>unescape(encoded_string);</code> to display ?</p>
  
  <p>Thanks.<br>
  Regards from France ;)</p>
  
  <p>EDIT : Forgot to mention : The data is a string from an user input (hence the security issues)</p>