且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google地理编码服务会返回错误400错误请求

更新时间:2023-01-03 19:22:09

好吧,我想出来了。

我的$ cityName变量是:

My $cityName variable was this:

$cityName = "Monterrey, NL";

逗号和NL之间的空格。我使用str_replace为+更改,并获得有效的网址,如文档中所示:

The white space between the comma and "NL". I used str_replace to change " " for "+" and get a valid url like in the documentation:

http://code.google.com/intl/es/apis/maps/documentation/geocoding/

问候,非常感谢您的帮助!

Greetings and thanks a lot for your help!