Thanks Dag 🙂
It is working perfectly,
my code:
$host = gethostbyaddr ($host_addr);
// From ? //
$array = explode(".", $host);
$top_domain = $array[sizeof($array)-1];
$country = "";
switch($top_domain) {
case 'com':$country="Commercial";break;
case 'arpa':$country="ARPANet";break;
case 'edu':$country="Education";break;
case 'gov':$country="Government";break;
// etc ..
default:
if (is_numeric($host))
$country = "Not a domain."; / host is an ip-address /
else
$country = "Unknown domain."; / domain not listed above /
}
// end From ? //
JackOnline
Internet International
http://www.internetintl.com