Here is my code
<?php
$prepAddr = str_replace(' ','+',$docAddress);
$geocode = file_get_contents('https://maps.google.com/maps/api/geocode/json?key=MY-API-KEY&address='.str_replace('#', '', $prepAddr).'&sensor=false');
$output = json_decode($geocode);
if($output){
$lat = $model->latitude = $output->results[0]->geometry->location->lat;
$lon = $model->longitude = $output->results[0]->geometry->location->lng;
}
?>
Its return Same latitude longitude.