PHP code example of black / geo

1. Go to this page and download the library: Download black/geo 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/ */

    

black / geo example snippets


$geo = new Geo\Coordinates(37.42242, -122.08585, 0);
$geo->getCoordinates(); // will return "37.42242,-122.08585,0"

Geo\Coordinates::fromCoordinatesAsString("37.42242,-122.08585,0")
    ->getLatitude(); // will return "37.42242"

Geo\Coordinates::fromCoordinatesAsArray([37.42242, -122.08585, 0])
    ->getCoordinates(); // will return "37.42242,-122.08585,0"