• PHP Video Tutorials

geoip_country_code3_by_name()



The geoip_country_code3_by_name() function can get the three letter country code.

Syntax

string geoip_country_code3_by_name( string $hostname )

The geoip_country_code3_by_name() function can return the three-letter country code corresponding to hostname or IP address.

The geoip_country_code3_by_name() function can return the three-letter country code on success, or false if an address can't be found in the database.

Example

<?php
   $country = geoip_country_code3_by_name("www.tutorialspoint.com');
   if($country) {
      echo "This host is located in: " . $country;
   }
?>
php_function_reference.htm
Advertisements