Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WenLiangTseng/6051646 to your computer and use it in GitHub Desktop.
Save WenLiangTseng/6051646 to your computer and use it in GitHub Desktop.
PHP用HTTP request取得Google Map資訊的方法
<?php
$url = 'http://maps.google.com/maps/geo?q=EC3M,+UK&output=csv&sensor=false';
$data = @file_get_contents($url);
$result = explode(",", $data);
echo $result[0]; // status code
echo $result[1]; // accuracy
echo $result[2]; // latitude
echo $result[3]; // longitude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment