Convert ISO country code to country name.

Public

Convert ISO country code to country name.

Get raw version
php
  1. /**
  2.  * Convert ISO country code to country name.
  3.  *
  4.  * @param string $country_code
  5.  * Country ISO code. Can be of any case.
  6.  */
  7. function zendigital_convert_country_code_to_country_name($country_code) {
  8. // Necessary for country_get_list().
  9. require_once DRUPAL_ROOT . '/includes/locale.inc';
  10. $countries = country_get_list();
  11. $cc = strtoupper($country_code);
  12. return isset($countries[$cc]) ? $countries[$cc] : FALSE ;
  13. }