Link to home
Start Free TrialLog in
Avatar of MWatkins84
MWatkins84

asked on

Distance between 2 cities

Hi Experts

I have a database of cities with the Longitude and Latitude. I want a user to select a city and then see the cities within a selected proximity in Kms. Whats the best way to do this with PHP?
 
Thanks
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

The "Haversine" formula can be used to compute the distance between two Lat/Lon pairs.  I will see if I have an example for you.  Best, ~Ray
ASKER CERTIFIED SOLUTION
Avatar of rpkhare
rpkhare
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MWatkins84
MWatkins84

ASKER

Thanks