For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, March 12, 2015

Latitude Longitude by address in php

You can find very easily Latitude and Longitude by given address with combination of Google map api and php.
You can easily implement in CodeIgniter,Laravel , CakePHP or any other framewok.

<?php
    $address = 'Sector 37,Noida,India';
    $geocode = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($address) . '&sensor=true');
    $geocode  = json_decode($geocode );
    echo 'Latitude:' . $geocode ->results[0]->geometry->location->lat;
    echo 'Longitude:' . $geocode ->results[0]->geometry->location->lng;

?>
Share:

0 comments:

Post a Comment

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights   You have a website and want to test it'...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive