I entered urls into a MySQL db and when I log it out as json /php I get this:
http:\/\/www.etc....
How can I fix this?
I entered urls into a MySQL db and when I log it out as json /php I get this:
http:\/\/www.etc....
How can I fix this?
JSON escapes /
as \/
- this is because older browser JavaScript need to use eval
to parse it, and many old browsers would use </
to mark the end of a JavaScript block. Therefore, \/
makes it safe.
This has nothing to do with MySQL, but is the JSON-encoding of your slashes.
See also: JSON: why are forward slashes escaped?