//Return Distance in meters between two coordinates//earth's circumference is 40030 Km long, divided in 360 degrees, that's 111190function calcDist($lat1,$lon1,$lat2,$lon2) { $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1-$lon2)); $dist = acos($dist); $dist = rad2deg($dist); return $dist * 111190; }