longitude and latitude distance calculation using php
Posted by Hawk under Dirty ScriptsLet Me Hear Your Thoughts >>
Creating a distance between cities using the geolite data that I’ve used in the the mapping IP-2-Location. If you look at longitude and latitude points in decimal format instead of the degrees:min:seconds then you can pretty much figure out how you calculate distance. Its the same way you do when you measure the distance between two points on a sphere.
Surprisingly, php has no support that I know of to convert degrees to radians, so I first built that, then the rest is just self explanatory.
“The world is a book and those who do not travel read only one page.” – St. Augustine
= 'Distance:'.$d ?











