Google Geocoder returns the same latitude and longitude for different addresses.Can anyone help me with this?

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.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.