From http://www.dzone.com/snippets/get-country-ip-address-php