Read more
PHP Geo
2015-11-05
PHP
PHP
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)
...........