class CountryList (View source)

Properties

protected $countries

Methods

__construct()

No description

loadCountries()

No description

array
getCountries()

Returns an array of countries with their short name as the key and their full name as the value

string|null
getCountryName(string $code)

Gets a country name given its code.

array
getCountriesForLanguage(string $languageCode, string $languageStatuses = 'orfm')

Return a list of territory codes where a specific language is spoken, sorted by the total number of people speaking that language.

Details

__construct()

protected loadCountries()

array getCountries()

Returns an array of countries with their short name as the key and their full name as the value

Return Value

array Keys are the country codes, values are the county names

string|null getCountryName(string $code)

Gets a country name given its code.

Parameters

string $code The country code

Return Value

string|null returns NULL if $code is not valid

array getCountriesForLanguage(string $languageCode, string $languageStatuses = 'orfm')

Return a list of territory codes where a specific language is spoken, sorted by the total number of people speaking that language.

Parameters

string $languageCode The language code (eg. 'en')
string $languageStatuses The allowed statuses of the languages, whose codes are 'o' (official), 'r' (official regional), 'f' (de facto official), 'm' (official minority), 'u' (unofficial or unknown)

Return Value

array Returns a list of country codes