Geodesy-PHP is a PHP port of some known geodesic functions for getting distance from a known point A to a known point B, given their latitude and longitude (good for working out distances between latitude/longitude data provided by Google Maps or any Restful APIs).
This has been helpful to me at a time when working out the distance between different vendors and the user's location (and check if they're within a certain range).
It provides distance calculations by:
You can read about it here