1. Go to this page and download the library: Download frostybee/geobee 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/ */
frostybee / geobee example snippets
use Frostybee\Geobee\Calculator;
/*
* Calculate the distance from downtown Montreal to Laval.
* From: Ville-Marie
* postal code area: H3A
* Latitude/Longitude: 45.4987, -73.5703
* To: Laval
* postal code area: H7T
* Latitude/Longitude: 45.55690, -73.7480
*/
$calculator = new Calculator();
$distance = $calculator->calculate(
$from_latitude,
$from_longitude,
$to_latitude,
$to_longitude
)->getDistance(); // Distance in meters.