loading
Please wait while loading...
Back PHP Geo

A nice library to calculate geographical distances for PHP.

example code:

use Location\Coordinate;
use Location\Distance\Haversine;

$coordinate1 = new Coordinate(19.820664, -155.468066); // Mauna Kea Summit
$coordinate2 = new Coordinate(20.709722, -156.253333); // Haleakala Summit

echo $coordinate1->getDistance($coordinate2, new Haversine()); // returns 128384.515 (meters; ≈128 kilometers)
 
https://github.com/mjaschen/phpgeo
Comments
comments powered by Disqus