Handles geolocation coordinates Latitude and Longitude values and output in DD or DMS formats.
Just do a require_once() of the geolocation-coordinates.php file.
First you need to add this repository in your composer.json file. For instance:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/camaleaun/php-geolocation-coordinates.git"
}
]
Then you have to do a
composer require camaleaun/php-geolocation-coordinates
Finally, in your code, you just have to call the library directly, or, if your project uses namespaces, you need to include it in your class:
use Camaleaun\GeolocationCoordinates;
You can either use it as an object or directly:
$coordinates = new GeolocationCoordinates($coordinates);
// DD
$coordinates = $converter->format('dd');
// DMS
$coordinates = $converter->format('dms');