/ Published in: PHP
Convert an address to geocode Latitude/Longitude positioning with PHP and Google Maps
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $address = '201 S. Division St., Ann Arbor, MI 48104'; // Google HQ $geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false'); $lat = $output->results[0]->geometry->location->lat; $long = $output->results[0]->geometry->location->lng; echo $address.'<br>Lat: '.$lat.'<br>Long: '.$long; ?>
URL: http://amiworks.co.in/talk/how-to-get-latitudelongitude-from-an-address-or-geocoding-using-php/