I have a code for get lat & long from address and find lat , long successfully.But some address not find lat and long and skip the code.here is my code.Please help me.
$address = 'Street 1, City, Country'; // Your address
$prepAddr = str_replace(' ','+',$address);
$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
$output= json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;
echo $address.'<br>Lat: '.$lat.'<br>Long: '.$long;