How to get latitude and longitude from address in php

you can get latitude and longitude by using google map api

$userAddress = urlencode ("Malviya Nagar Jaipur");
$aAddressData = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=$userAddress&sensor=false");
$aAddressDataDecode = json_decode($aAddressData);
$userLatitude = $aAddressDataDecode->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
$userLongitude =	$aAddressDataDecode->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
Share on Google+Share on FacebookTweet about this on TwitterEmail this to someone