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