How to calculate the distance between two latitudes and longitudes



I am using google maps which is displaying the route. I want to calculate how many kilometers the person has traveled.
I am storing the latitudes and longitudes in the database

Please provide me the code

Thanks and regards.


Take a look at the PHP in the first post of this thread: