PHP: Get Location

    function getLocationName(){
	$tz = new DateTimeZone("Asia/Dhaka");
	$loc=$tz->getLocation();
	$geocode=file_get_contents('http://maps.googleapis.com/maps/api/geocode/
        json?latlng='.$loc['latitude'].','.$loc['longitude'].'&sensor=false');
	$output= json_decode($geocode);
	$output->results[0]->formatted_address;
	}