convert ip to latitude longitude using php
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo $details->city; // -> "Mountain View"//You can use an api:
//Link to documentation: https://ip-get-geolocation.com/documentation/
$LocationArray = json_decode( file_get_contents('http://ip-get-geolocation.com/api/json/35.188.125.133'), true);
echo $LocationArray['country'];
echo $LocationArray['city'];
echo $LocationArray['region'];
echo $LocationArray['timezone'];
Also in PHP:
- add date ti particular date in php
- add days to date in php
- adding days to data php
- column of csv to array php
- fetch today data in php
- class 'illuminate support facades input' not found laravel 7
- ALL CODE FOR DATABASE PHP
- datetime php create from timestamp
- elevated th in dates format php
- Argument 1 passed to NotORM_Result::update() must be of the type array, string php slim
- find if string contains characters php
- all date format in php
- create random password in php
- after validate credential header is not redirect to another page in php in live server
- amazon linux 2 php.ini changes not working
- composer php version command
- date() function
- find if a string contain any of a given words php
- array_values() in php
- date('c') php
- create migration laravel
- Throw new error php
- add seeder laravel
- exception is thrown php