Google Maps - converting address to latitude & longitude - PHP backend?

后端 未结 4 1396
自闭症患者
自闭症患者 2021-01-02 01:09

is it possible to convert (in PHP back-end):


to

         


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-02 01:37

    This works for me:

    status;
      if ($status=="OK") {
          $Lat = $xml->result->geometry->location->lat;
          $Lon = $xml->result->geometry->location->lng;
          $LatLng = "$Lat,$Lon";
      }
    ?>
    

    References:

    • http://www.fcsoftware.co.uk/blog/?p=66
    • https://developers.google.com/maps/documentation/geocoding

提交回复
热议问题