Get location via IPAddress.

$ipaddress=’xxx.xx.xx.xxx’;
$ch = curl_init();

curl_setopt ($ch,CURLOPT_URL,”https://www.geoplugin.net/php.gp?ip=’$ipaddress'”);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 30);
$geoData = unserialize(curl_exec($ch));
$curl_error = curl_error($ch);
curl_close($ch);
print_r($geoData);

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit exceeded. Please complete the captcha once again.