1. Go to this page and download the library: Download goosfraba/gps 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/ */
goosfraba / gps example snippets
use Goosfraba\Gps\GpsCoordinates;
$coordinates = GpsCoordinates::createFromDegrees(38.8, -77.1);
// or
$coordinates = GpsCoordinates::createFromRadians(0.677187749773799875846392, -1.3456488532876281038081655);
// accessing coordinates in radians
$latitudeInRadians = $coordinates->latitudeInRadians();
$longitudeInRadians = $coordinates->longitudeInRadians();
// accessing coordinates in degrees
$latitudeInDegrees = $coordinates->latitudeInDegrees();
$longitudeInDegrees = $coordinates->longitudeInDegrees();