Getting visitors country from their IP

geoplugin

geoPlugin is a free and easy webmaster resource to provide geolocation technology to your pages.

$xml = simplexml_load_file('http://www.geoplugin.net/xml.gp?ip='.$visitor_ip_address);
 
foreach ($xml as $key => $value)
{
    echo $key , '= ' , $value ,  '<br>';
}
Categories: PHP Tags: , , , , , ,
%d bloggers like this: