bu iş için kullandığımız fonksiyon;
PHP Kod:
<?
function get_country () {
$Ip_Address = $_SERVER[‘REMOTE_ADDR’];
$Geo_Plugin_XML = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=" . $Ip_Address);
$Country = $Geo_Plugin_XML->geoplugin_countryName;
return $Country;
}
?>
PHP Kod:
<?
echo $country = get_country();
?>