For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Saturday, November 08, 2014

latitude and longitude by zip in php

PROBLEM:
How to get latitude and longitude by zip/pin in php

SOLUTION:
Here I am demonstrating to you that how can you get latitude and longitude by zip code or pin code in php.

$pin="208017";
$full_url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$pin."&sensor=false";
$details=file_get_contents($full_url);
$rs = json_decode($details,true);
$lat=$rs['results'][0]['geometry']['location']['lat'];
$lng=$rs['results'][0]['geometry']['location']['lng'];
echo  "Latitude :" .$lat;
echo '<br>';
echo "Longitude :" .$lng;

Share:

0 comments:

Post a Comment

How to make center align child div

 How to make center align child div?   Suppose you have 2 Div tag. And want the make inner tag center <div id="d1">      ...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive