1. Go to this page and download the library: Download ixnode/php-coordinate 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/ */
$coordinateDresden = new Coordinate('51°3′1.44″N 13°44′14.28″E');
$coordinateCordoba = new Coordinate(-31.425299, -64.201743);
/* Distance between Dresden, Germany and Córdoba, Argentina */
print $coordinate->getDistance($coordinateCordoba, Coordinate::RETURN_KILOMETERS);
// (float) 11904.668
$coordinateDresden = new Coordinate('51°3′1.44″N 13°44′14.28″E');
$coordinateCordoba = new Coordinate(-31.425299, -64.201743);
/* Direction in degrees from Dresden, Germany to Córdoba, Argentina */
print $coordinateDresden->getDegree($coordinateCordoba);
// (float) -136.62°
$coordinateDresden = new Coordinate('51°3′1.44″N 13°44′14.28″E');
$coordinateCordoba = new Coordinate(-31.425299, -64.201743);
/* Direction in degrees from Dresden, Germany to Córdoba, Argentina */
print $coordinateDresden->getDirection($coordinateCordoba);
// (string) SW