我正在使用 PHP 中的
json_encode
对 URL 进行编码。$json_string = array ('myUrl'=> 'http://example.com');
echo json_encode ($json_string);
以上代码生成以下 JSON 字符串:
{"myUrl":"http:\/\/example.com"}
与其
{"myUrl":"http://example.com"}
我是一个新手,哪个输出是正确的?JSON解析器能够正确评估第二个输出吗?