title: Why does json_encode escape the forward slash ( / )?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped">JSON: why are forward slashes escaped?</a>  </p>
  </blockquote>
  
  
  
  <p>The function argument below is a string run through <code>json_encode()</code>.  I see that the forward slash in <code>http://</code> is escaped to <code>http:\/\/</code>.
  Obviously it is a special character when used like this <code>&lt;some_tag&gt;&lt;/some_tag&gt;</code> but only when used in that structure.</p>
  
  <p>There is no immediate problem..but I need to understand escapes to make some code updates.</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;Arc.ViewHBookmark('[{"id":"1","0":"1","title":"cybercoders","1":"cybercoders","url":"http:\/\/cybercoders.com","2":"http:
  </code></pre>
  
  <p>php.net - <a href="http://php.net/manual/en/function.json-encode.php" rel="nofollow noreferrer">json_encode</a></p>
  
  <p><strong>Related</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped">JSON: why are forward slashes escaped?</a></p>