geoip_country_name_by_name()
The geoip_country_name_by_name() function can get the full country name.
Syntax
string geoip_country_name_by_name( string $hostname )
The geoip_country_name_by_name() function can return the full country name corresponding to hostname or IP address.
The geoip_country_name_by_name() function can return the country name on success, or false if the address can't be found in the database.
Example
<?php
$country = geoip_country_name_by_name("www.tutorialspoint.com");
if($country) {
echo "This host is located in: " . $country;
}
?>
php_function_reference.htm
Advertisements