Codice PHP:
function ip2country($type, $where = "./") {
// Author: andr3a [ [url]www.3site.it[/url] ] [ [email]andrea@3site.it[/email] ]
// Author: mdsjack [ [url]www.mdsjack.tk/[/url] ] [ [email]mdsjack@iol.it[/email] ]
$ip = split("[.]", $_SERVER["REMOTE_ADDR"]);
$ip = ($ip[0] * 16777216) + ($ip[1] * 65536) + ($ip[2] * 256) + ($ip[3]);
$csv = fopen($where."ip-to-country.csv", "r");
while ($line = fgetcsv($csv, 1024)) {
list ($from, $to, $code[0], $code[1], $code[2]) = $line;
if (($from <= $ip) and ($to >= $ip)) {
fclose($csv);
$sended = isSet($code[$type-1]) && $code[$type-1]!='' ? $code[$type-1] : "UNK";
return $sended;
}
}
fclose($csv);
return "YOU";
}
questo ti restituisce la nazionalità in diversa forma asecondo del parametro type:
1 - stringa di due caratteri
2 - stringa di tre
3 - nome esteso
(mi pare)
Devi solo mettere nella stessa directory anche il file ip-to-country.csv che trovi in rete [http://ip-to-country.directi.com/]
la usi così:
echo ip2country(1); //ti stamperà IT
quindi
Codice PHP:
switch (ip2country(1))
{
case 'IT':
echo "Italia";
break;
case 'NL':
echo "Olanda";
break;
default:
echo "boh";
}
chiaro? 
poi dipende esattamente da cosa devi farci