Question: how to calculate distance and time between two latitude and longitude in php?
Answer: function distance($lat1, $lon1, $lat2, $lon2) {
$pi80 = M_PI / 180;
$lat1 *= $pi80;
$lon1 *= $pi80;
$lat2 *= $pi80;
$lon2 *= $pi80;
$r = 6372.797; // mean radius of Earth in km.
$dlat = $lat2 - $lat1;