google maps api 3 - How to convert GPS coordinates to a full address with php? -


this question has answer here:

i have gps coordinates in form 54.1456123 10.413456.

how can convert them php addresses postal code, street , city?

use google api

$lat="54.1456123"; $long = "10.413456";  $url = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$long&sensor=false";  $curl = curl_init(); curl_setopt($curl, curlopt_url, $url); curl_setopt($curl, curlopt_header, false); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_encoding, ""); $curldata = curl_exec($curl); curl_close($curl);  $address = json_decode($curldata); print_r($address); 

Comments