0
我没有得到任何来自谷歌的地方文本搜索API响应没有从谷歌的地方文本搜索API响应
这里是我的PHP代码:
$string=$row["PropertyTitle"].'+'.$row["LocalityName"].'+'.$row["CityName"];
$details_url="https://maps.googleapis.com/maps/api/place/textsearch/json?query=".$city."&key=someapikey";
curl_setopt($ch, CURLOPT_URL, $details_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$geoloc = json_decode(curl_exec($ch), true);
print_r($geoloc);
它甚至不给下面的结果
{
"html_attributions" : [],
"results" : [],
"status" : "INVALID_REQUEST"
}
我在做什么错误以及如何解决这个问题?
哦,太棒了,您发布了您的API密钥。顺便说一句,你是否正确地编码你的'$城市'? – Raptor
您正在查询参数中传递'$ city',但好像您尚未定义。 – WisdmLabs
@WisdmLabs很好的接收! – Raptor