You are here

function geoip_region_name in GeoIP API 7

Same name and namespace in other branches
  1. 6 geoip.module \geoip_region_name()
  2. 7.2 geoip.module \geoip_region_name()

API function to retrieve the region name, given a country code and region code. This function relies on the geoipregionvars.php file, which is just a huge array.

Return value

string

Related topics

File

./geoip.module, line 217
API for using the MaxMind GeoLite Country database.

Code

function geoip_region_name($country_code, $region_code) {
  static $GEOIP_REGION_NAME;
  if (!isset($GEOIP_REGION_NAME)) {
    include drupal_get_path('module', 'geoip') . '/lib/geoipregionvars.php';
  }
  return $GEOIP_REGION_NAME[$country_code][$region_code];
}