我知道这在Javascript中是可行的但我只需要使用PHP来做,我该怎么办?
小智 8
和其他方式:
$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false');
$output= json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;
Run Code Online (Sandbox Code Playgroud)