shaashwato1308

PHP - Google GeoCoding API

Sep 19th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. $url="http://maps.googleapis.com/maps/api/geocode/json?address=".urlencode($house_address);
  2. $json = file_get_contents($url);
  3. $data = json_decode($json, TRUE);
  4. $house_address_lat = $data['results'][0]['geometry']['location']['lat'];
  5. $house_address_long = $data['results'][0]['geometry']['location']['lng'];
Add Comment
Please, Sign In to add comment