adecoder / coordinate
Distance Calculate and 3rd Party API Services in PHP
1.0
2022-02-01 11:47 UTC
Requires
- php: >=8.0
This package is auto-updated.
Last update: 2025-03-01 00:37:05 UTC
README
Distance Calculate and 3rd Party API Services in PHP
Installation
composer require adecoder/coordinate
Environment Varaible
IP_API_KEY=your-api-key IP_API_URL=http://api.ipapi.com/ POSITION_STACK_KEY=your-api-key POSITION_STACK_URL=http://api.positionstack.com/v1/reverse
Distance Calculate
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');
IP Details
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>';
GeoLocation Details
use Adecoder\Coordinate\Lookup; $coords = new Lookup(); echo '<pre>'; print_r($loopup->coords(lat: '23.6307225', lng: '90.4901339')) echo '</pre>';