住所から簡単にジオコードを調べる方法
こんな方法もあるが、処理上でジオコードを取得したいときは
$address = '東京都目黒区中目黒2-10-15'; $geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.urlencode($address).'&sensor=false'); $output= json_decode($geocode); $lat = $output->results[0]->geometry->location->lat; $long = $output->results[0]->geometry->location->lng; echo $lat.','.$long;
出力:
35.6406465,139.7027264