<?php function getLnt($zip){ $url = "http://maps.googleapis.com/maps/api/geocode/json?address= ".urlencode($zip)."&sensor=false"; $result_string = file_get_contents($url); $result = json_decode($result_string, true); return $result['results'][0]['geometry']['location']; } $val = getLnt('75204'); echo "Latitude: ".$val['lat']."<br>"; echo "Longitude: ".$val['lng']."<br>"; ?>
You have javascript disabled. You will not be able to edit any code.