1. Go to this page and download the library: Download anthonymartin/geo-location library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
anthonymartin / geo-location example snippets
AnthonyMartin\GeoLocation\GeoPoint;
$start = new GeoPoint(52.205, 0.119);
$end = new GeoPoint(48.857, 2.351);
$kilometers = $start->distanceTo($end, 'km'); // about 404.3 km
$moved = $start->withLatitude(53); // $start is unchanged
AnthonyMartin\GeoLocation\GeoPoint;
$start = new GeoPoint(52.205, 0.119);
$destination = $start->destination(10, 90, 'km'); // 10 km east
$bearing = $start->bearingTo($destination);
$midpoint = $start->midpointTo($destination);