function googleGeoCoder($address){ $key = "MY-KEY-GOES-HERE"; $url = 'http://maps.google.com/maps/geo?q='.urlencode($address).'&output=csv&key='.$key; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER,0); //Change this to a 1 to return headers curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); $data = explode(",",$data); return $data; }