You are here

function countries_api_get_options_array in Country codes API 6

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

Function for returning an associative array useful for FAPI select elements

Parameters

array: The first value in the array (defaults to '' => 'Please Choose')

Return value

array Returns an associative array in $country['iso2'] => $country['printable_name'] format.

2 calls to countries_api_get_options_array()
CountriesAPITestCase::test_countries_api_get_options_array in tests/countries_api.test
Function to test countries_api_get_options_array results
countries_api_service_get_options_array in contrib/countries_api_service/countries_api_service.module
Returns an array of countries

File

./countries_api.module, line 262
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_get_options_array($first_element = array(
  '' => 'Please Choose',
)) {
  return array_merge($first_element, countries_api_get_array(COUNTRIES_API_FORMAT_ISO2, COUNTRIES_API_FORMAT_PRINTABLE_NAME));
}