You are here

function location_taxonomize_get_country_code in Location Taxonomize 7.2

Uses the core countries list to return a country code given a name

File

./location_taxonomize.inc, line 311
Some useful functions for Location taxonomize

Code

function location_taxonomize_get_country_code($name) {
  require_once DRUPAL_ROOT . '/includes/locale.inc';
  $countries = country_get_list();
  $names = array_keys($countries, $name);
  if (!empty($names)) {
    return array_pop($names);
  }
  return NULL;
}