How to find latitude and longitude from zipcode with example

Prem Tiwari - - PHP Tutorial


Hi friend, In a previous tutorial, I have shared How to find address with latitude and longitude. I have got some tutorial request from my website readers to also create a tutorial about how to get latitude and longitude from postal code with an example.

So today, I am sharing the simple peace of code to get the latitude and longitude by using the zip code of any location.

How to get latitude and longitude from zip code with example

Live Demo           Download

How to find longitude and latitude by zip code with example

To get the latitude and longitude by using the postal code, we will use the google map API. In this tutorial, I have used below google map URL to get the latitude and longitude from postal code.

http://maps.googleapis.com/maps/api/geocode/json?address=134114&sensor=true

Create a index.php and add below “getLatLongFormPostalCode()” function to get latitude and longitude suign above google map API url.


Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Tags: , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.