Countries
extends ResourceBundle
in package
Gives access to region-related ICU data.
Tags
Table of Contents
Methods
- alpha3CodeExists() : bool
- exists() : bool
- getAlpha2Code() : string
- getAlpha3Code() : string
- getAlpha3Codes() : array<string|int, string>
- Returns all available countries (3 letters).
- getAlpha3Name() : string
- Gets the country name from its alpha3 code.
- getAlpha3Names() : array<string, string>
- Gets the list of country names indexed with alpha3 codes as keys.
- getCountryCodes() : array<string|int, string>
- Returns all available countries.
- getName() : string
- Gets the country name from its alpha2 code.
- getNames() : array<string, string>
- Gets the list of country names indexed with alpha2 codes as keys.
- getPath() : string
Methods
alpha3CodeExists()
public
static alpha3CodeExists(string $alpha3Code) : bool
Parameters
- $alpha3Code : string
Return values
boolexists()
public
static exists(string $alpha2Code) : bool
Parameters
- $alpha2Code : string
Return values
boolgetAlpha2Code()
public
static getAlpha2Code(string $alpha3Code) : string
Parameters
- $alpha3Code : string
Return values
stringgetAlpha3Code()
public
static getAlpha3Code(string $alpha2Code) : string
Parameters
- $alpha2Code : string
Return values
stringgetAlpha3Codes()
Returns all available countries (3 letters).
public
static getAlpha3Codes() : array<string|int, string>
Countries are returned as uppercase ISO 3166 three-letter country codes.
This list only contains "officially assigned ISO 3166-1 alpha-3" country codes.
Return values
array<string|int, string>getAlpha3Name()
Gets the country name from its alpha3 code.
public
static getAlpha3Name(string $alpha3Code[, string $displayLocale = null ]) : string
Parameters
- $alpha3Code : string
- $displayLocale : string = null
Tags
Return values
stringgetAlpha3Names()
Gets the list of country names indexed with alpha3 codes as keys.
public
static getAlpha3Names([string $displayLocale = null ]) : array<string, string>
Same as method getNames, but with alpha3 codes instead of alpha2 codes as keys.
Parameters
- $displayLocale : string = null
Return values
array<string, string>getCountryCodes()
Returns all available countries.
public
static getCountryCodes() : array<string|int, string>
Countries are returned as uppercase ISO 3166 two-letter country codes.
A full table of ISO 3166 country codes can be found here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
This list only contains "officially assigned ISO 3166-1 alpha-2" country codes.
Return values
array<string|int, string>getName()
Gets the country name from its alpha2 code.
public
static getName(string $country[, string $displayLocale = null ]) : string
Parameters
- $country : string
- $displayLocale : string = null
Tags
Return values
stringgetNames()
Gets the list of country names indexed with alpha2 codes as keys.
public
static getNames([string $displayLocale = null ]) : array<string, string>
Parameters
- $displayLocale : string = null
Return values
array<string, string>getPath()
protected
static getPath() : string