当我json_encode一个url数组时,它用下划线代替句号


When I json_encode an array of URLs it replaces periods with underscores

是什么原因导致json_encode()用下划线代替句号?我不能让它在我的脚本中这样做,因为它会破坏使用URL数组的curl调用。

适合我:

>> json_encode(array('www.url.com','mail.google.com/mail/?hl=en&tab=wm'));
'["www.url.com","mail.google.com''/mail''/?hl=en&tab=wm"]'

不是json_encode()。

当PHP 接收 POST/GET变量时(我假设这是关于的,因为json_encode不会这样做),用下划线替换键中的点(我认为register_globals遗留)。

要么围绕它工作,要么手动解析$_SERVER['QUERY_STRING']GET 's或file_get_contents('php://input');POST