R.Shokeen
0
Q:

Find ip address location php

$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo $details->city; // -> "Mountain View"
2
//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']; 
1

New to Communities?

Join the community