Get location via IPAddress.

Get location via IPAddress.

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

curl_setopt ($ch,CURLOPT_URL,”http://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);

ip

Latest Blogs