You are here

function countries_api_get_country in Country codes API 5

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

ISO 3166-1-alpha-#n code to country API function

Parameters

$code : An string containg the iso3 value

Return value

string Returns an array containing the country fields

File

./countries_api.module, line 27

Code

function countries_api_get_country($code) {
  if (strlen(trim($code)) == 2) {
    return countries_api_iso2_get_country($code);
  }
  elseif (strlen(trim($code)) == 3) {
    return countries_api_iso3_get_country($code);
  }
  else {
    return null;
  }
}