• PHP Video Tutorials

geoip_region_name_by_code()



The geoip_region_name_by_code() function can return the region name for some country and region code combo.

Syntax

string geoip_region_name_by_code( string $country_code , string $region_code )

The geoip_region_name_by_code() function can return the region name corresponding to a country and region code combo.

The geoip_region_name_by_code() function is always available if using GeoIP library version 1.4.1 or newer. The data can be taken directly from the GeoIP library and not from any database.

The geoip_region_name_by_code() function can return the region name on success, or false if the country and region code combo can't be found.

Example

<?php
   $region = geoip_region_name_by_code("CA", "QC");
   if($region) {
      echo "Region name for CA/QC is: " . $region;
   }
?>
php_function_reference.htm
Advertisements