<?php


function getaddress($lat,$lng)
  {
     $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='.trim($lat).','.trim($lng).'&sensor=false&key=AIzaSyCVpBowbdZqwo-eMCbY_lVhhuQj5aUn3Tk';
     $json = @file_get_contents($url);
     $data=json_decode($json);
     $status = $data->status;
     if($status=="OK")
     {
       return $data->results[1]->formatted_address;
     }
     else
     {
       return false;
     }
  }

// $lat= 6.5067035; //latitude
// $lng= 3.2022922; //longitude
 // $address= getaddress($lat,$lng);
  
  /*if($address)
  {
    echo $address;
  }
  else
  {
    echo "Not found";
  }
*/

?>












