You are here

function countries_api_iso2_get_iso3 in Country codes API 6

Same name and namespace in other branches
  1. 5 countries_api.module \countries_api_iso2_get_iso3()

ISO 3166-1-alpha-2 code to ISO 3166-1-alpha-3 code API function

Parameters

$code: iso2 country code to search by.

Return value

string Returns iso3 string value of country

1 call to countries_api_iso2_get_iso3()
CountriesAPITestCase::test_countries_api_iso2_get_iso3 in tests/countries_api.test
Function to test countries_api_iso2_get_iso3() results

File

./countries_api.module, line 125
Countries API provides an API for official and up-to-date ISO 3166 country codes (alpha-2 and alpha-3) and names (official short names).

Code

function countries_api_iso2_get_iso3($code) {
  $_country = countries_api_iso2_get_country($code);
  if (!is_null($_country)) {
    return $_country[COUNTRIES_API_FORMAT_ISO3];
  }
  return NULL;
}