I've worked with google maps before, but when implementing it, I've never found any documentation on how to get the exact distance between 2 given locations via Javascript or PHP.
1) It has to be the exact same distance shown on maps, not that formula that gives you the distance in a straight line from one geopoint to the other.
2) It has to be either PHP or Javascript
3) It has to be Google maps, not virtual earth or anything similar.
Best thing I've come up with is sending a HTTP_GET request to google maps using a long URL with variables, which then returns a 200 code plus the HTML for the website. The distance is in there somewhere, just need to filter.
But that's resources intensive and load heavy.
Does anybody know of a better way?
EDIT: this is the function I'm talking about. The DLL isn't included in the regular zip file for windows, I found it as a part of the WAMPserver software.