• PHP Video Tutorials

PHP - geoip_domain_by_name()



The geoip_domain_by_name() function can get the second level domain name.

Syntax

string geoip_domain_by_name ( string $hostname )	

The geoip_domain_by_name() function can return the second-level domain names associated with the hostname or IP address.

The geoip_domain_by_name() function is currently only available to users who have bought a commercial GeoIP Domain Edition. A warning can be issued if the proper database can't be located.

The geoip_domain_by_name() function can return the domain name on success, or false if the address can't be found in the database.

Example

<?php
   $domain = geoip_domain_by_name("61.106.139.1");

   if($domain) {
      echo "The domain is:"'. $domain;
   }
?>
php_function_reference.htm
Advertisements