PHP code example of adecoder / coordinate

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

    

adecoder / coordinate example snippets

 
use Adecoder\Coordinate\Distance;

$area = new Distance();
echo $area->set(lat1: 23.6293159, lng1: 90.4870177, lat2: 24.3761958, lng2: 88.5793325)->get(unit: 'k');
 
use Adecoder\Coordinate\Lookup;
use Adecoder\Coordinate\Clients\Services\IpApi;

$loopup = new Lookup();
echo '<pre>';
print_r($loopup->ipaddr(ip: '103.151.11.64'))
echo '</pre>';
 
use Adecoder\Coordinate\Lookup;

$coords = new Lookup();
echo '<pre>';
print_r($loopup->coords(lat: '23.6307225', lng: '90.4901339'))
echo '</pre>';