How to find latitude and longitude from zipcode with example

| Last Updated: | In: 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.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:


, , , , , , , , , , ,