We install GeoIP modules on all of our servers and keep the database as up to date as possible.
The below output should show something like the below.
Country Code: NZ
Country: New Zealand
Continent Code: OC
$GEOIP_COUNTRY_CODE = $_SERVER['GEOIP_COUNTRY_CODE'];
print "Country Code: " . $GEOIP_COUNTRY_CODE;
$GEOIP_COUNTRY_NAME = $_SERVER['GEOIP_COUNTRY_NAME'];
print "Country: " . $GEOIP_COUNTRY_NAME;
$CONTINENT_COD = $_SERVER['GEOIP_CONTINENT_CODE'];
print "Continent Code: " . $CONTINENT_COD;