1
Google APIを使用すると、緯度、緯度、経度を取得し、同じ特定の国を取得します。どうしたらいいですか? (PHPを使用)Google APIを使用する場所からの緯度、経度を取得し、特定の国を取得する(PHPを使用)
$formattedAddr = str_replace(' ','+',$address);
//Sending request and receive json data by address
$geocodeFromAddr=file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.$formattedAddr.'&sensor=false');
$output = json_decode($geocodeFromAddr);
//Get latitude and longitute from json data
$data['latitude'] = $output->results[0]->geometry->location->lat;
$data['longitude'] = $output->results[0]->geometry->location->lng;