title: mysql_real_escape_string leaves slashes
body: <p>I am using post method to send data. And the data is an array so I just use <code>encodeURIComponent</code> before it is send.</p>
  
  <p>POST data:</p>
  
  <pre><code>    data = "data="+encodeURIComponent(JSON.stringify(data));
  </code></pre>
  
  <p>And in the receiving page:</p>
  
  <pre><code>    $data =  json_decode($_POST['data'], true);
  </code></pre>
  
  <p>In the <code>for</code> loop I used <code>mysql_real_escape_string</code></p>
  
  <pre><code>    for($i=0;$i&lt;$count;$i++)
      {
          $data[$i] = trim(mysql_real_escape_string($data[$i]));
      }
  </code></pre>
  
  <p>The problem is this method causes a slash in the data which is saved to database. Help me to remove the slash automatically added. (Sometimes data may contain a slash which cannot be removed.)</p>