0

How to Calculate distance between two points in php using latitude and longitude

In this quick tutorial I am going to share a quick php function to Calculate distance between two points in php using latitude and longitude,This below function calculates the distance between two points.
Passed to function:
lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees)
lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees)

 

Here is the function.

Example.

Leave a Reply

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