Why does JSON encoder adds escaping character when encoding URLs?

speakeasy602

New Member
I am using \[code\]json_encode\[/code\] in PHP to encode an URL\[code\]$json_string = array ('myUrl'=> 'http://example.com');echo json_encode ($json_string);\[/code\]The above code generates the following JSON string:\[code\]{"myUrl":"http:\/\/example.com"} \[/code\]Rather than\[code\]{"myUrl":"http://example.com"}\[/code\]I am just newbie, which output is correct? Is JSON parser able to evaluate the second output correctly?
 
Back
Top