Online Forum To Support Coders With Technical Assistance - Read Write Execute

How to get geolocation data from postal code

Ankit Agrawal
Ankit Agrawal
Published on September 5, 2015 · 1 min read
<?php
$zip = "302017";
$url ="http://maps.googleapis.com/maps/api/geocode/xml?address=$zip";
$result = simplexml_load_file($url);
print_r($result);
?>
Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article How to set option selected for select box in cakephp ? Next Article → How to send email in cakephp ?