You are here

function countries_api_iso2_get_name in Country codes API 5

Same name and namespace in other branches
  1. 6 countries_api.module \countries_api_iso2_get_name()

ISO 3166-1-alpha-2 code to country name API function

Parameters

$code: iso2 country code to search by.

Return value

string Returns country name as string.

3 calls to countries_api_iso2_get_name()
CountriesApiTest::test_countries_api_iso2_get_name in tests/countries_api.test
Function to test results of countries_api_iso2_get_name()
CountriesApiTest::test_nullcountries_api_iso2_get_name in tests/countries_api.test
Function to test results of countries_api_iso2_get_name()
countries_api_get_name in ./countries_api.module
ISO 3166-1-alpha-#n code to country name API function

File

./countries_api.module, line 87

Code

function countries_api_iso2_get_name($code) {
  $_country = countries_api_iso2_get_country($code);
  if (!is_null($_country)) {
    return $_country['name'];
  }
  return null;
}