country name pairs. */ protected $countries; /** * Get an array of all two-letter country code => country name pairs. * * @return array * An array of country code => country name pairs. */ public static function getStandardList() { $countries = [ 'AC' => __('Ascension Island', 'wtotem'), 'AD' => __('Andorra', 'wtotem'), 'AE' => __('United Arab Emirates', 'wtotem'), 'AF' => __('Afghanistan', 'wtotem'), 'AG' => __('Antigua & Barbuda', 'wtotem'), 'AI' => __('Anguilla', 'wtotem'), 'AL' => __('Albania', 'wtotem'), 'AM' => __('Armenia', 'wtotem'), 'AN' => __('Netherlands Antilles', 'wtotem'), 'AO' => __('Angola', 'wtotem'), 'AQ' => __('Antarctica', 'wtotem'), 'AR' => __('Argentina', 'wtotem'), 'AS' => __('American Samoa', 'wtotem'), 'AT' => __('Austria', 'wtotem'), 'AU' => __('Australia', 'wtotem'), 'AW' => __('Aruba', 'wtotem'), 'AX' => __('Åland Islands', 'wtotem'), 'AZ' => __('Azerbaijan', 'wtotem'), 'BA' => __('Bosnia & Herzegovina', 'wtotem'), 'BB' => __('Barbados', 'wtotem'), 'BD' => __('Bangladesh', 'wtotem'), 'BE' => __('Belgium', 'wtotem'), 'BF' => __('Burkina Faso', 'wtotem'), 'BG' => __('Bulgaria', 'wtotem'), 'BH' => __('Bahrain', 'wtotem'), 'BI' => __('Burundi', 'wtotem'), 'BJ' => __('Benin', 'wtotem'), 'BL' => __('St. Barthélemy', 'wtotem'), 'BM' => __('Bermuda', 'wtotem'), 'BN' => __('Brunei', 'wtotem'), 'BO' => __('Bolivia', 'wtotem'), 'BQ' => __('Caribbean Netherlands', 'wtotem'), 'BR' => __('Brazil', 'wtotem'), 'BS' => __('Bahamas', 'wtotem'), 'BT' => __('Bhutan', 'wtotem'), 'BV' => __('Bouvet Island', 'wtotem'), 'BW' => __('Botswana', 'wtotem'), 'BY' => __('Belarus', 'wtotem'), 'BZ' => __('Belize', 'wtotem'), 'CA' => __('Canada', 'wtotem'), 'CC' => __('Cocos (Keeling) Islands', 'wtotem'), 'CD' => __('Congo - Kinshasa', 'wtotem'), 'CF' => __('Central African Republic', 'wtotem'), 'CG' => __('Congo - Brazzaville', 'wtotem'), 'CH' => __('Switzerland', 'wtotem'), 'CI' => __('Côte d’Ivoire', 'wtotem'), 'CK' => __('Cook Islands', 'wtotem'), 'CL' => __('Chile', 'wtotem'), 'CM' => __('Cameroon', 'wtotem'), 'CN' => __('China', 'wtotem'), 'CO' => __('Colombia', 'wtotem'), 'CP' => __('Clipperton Island', 'wtotem'), 'CR' => __('Costa Rica', 'wtotem'), 'CU' => __('Cuba', 'wtotem'), 'CV' => __('Cape Verde', 'wtotem'), 'CW' => __('Curaçao', 'wtotem'), 'CX' => __('Christmas Island', 'wtotem'), 'CY' => __('Cyprus', 'wtotem'), 'CZ' => __('Czechia', 'wtotem'), 'DE' => __('Germany', 'wtotem'), 'DG' => __('Diego Garcia', 'wtotem'), 'DJ' => __('Djibouti', 'wtotem'), 'DK' => __('Denmark', 'wtotem'), 'DM' => __('Dominica', 'wtotem'), 'DO' => __('Dominican Republic', 'wtotem'), 'DZ' => __('Algeria', 'wtotem'), 'EA' => __('Ceuta & Melilla', 'wtotem'), 'EC' => __('Ecuador', 'wtotem'), 'EE' => __('Estonia', 'wtotem'), 'EG' => __('Egypt', 'wtotem'), 'EH' => __('Western Sahara', 'wtotem'), 'ER' => __('Eritrea', 'wtotem'), 'ES' => __('Spain', 'wtotem'), 'ET' => __('Ethiopia', 'wtotem'), 'FI' => __('Finland', 'wtotem'), 'FJ' => __('Fiji', 'wtotem'), 'FK' => __('Falkland Islands', 'wtotem'), 'FM' => __('Micronesia', 'wtotem'), 'FO' => __('Faroe Islands', 'wtotem'), 'FR' => __('France', 'wtotem'), 'GA' => __('Gabon', 'wtotem'), 'GB' => __('United Kingdom', 'wtotem'), 'GD' => __('Grenada', 'wtotem'), 'GE' => __('Georgia', 'wtotem'), 'GF' => __('French Guiana', 'wtotem'), 'GG' => __('Guernsey', 'wtotem'), 'GH' => __('Ghana', 'wtotem'), 'GI' => __('Gibraltar', 'wtotem'), 'GL' => __('Greenland', 'wtotem'), 'GM' => __('Gambia', 'wtotem'), 'GN' => __('Guinea', 'wtotem'), 'GP' => __('Guadeloupe', 'wtotem'), 'GQ' => __('Equatorial Guinea', 'wtotem'), 'GR' => __('Greece', 'wtotem'), 'GS' => __('South Georgia & South Sandwich Islands', 'wtotem'), 'GT' => __('Guatemala', 'wtotem'), 'GU' => __('Guam', 'wtotem'), 'GW' => __('Guinea-Bissau', 'wtotem'), 'GY' => __('Guyana', 'wtotem'), 'HK' => __('Hong Kong SAR China', 'wtotem'), 'HM' => __('Heard & McDonald Islands', 'wtotem'), 'HN' => __('Honduras', 'wtotem'), 'HR' => __('Croatia', 'wtotem'), 'HT' => __('Haiti', 'wtotem'), 'HU' => __('Hungary', 'wtotem'), 'IC' => __('Canary Islands', 'wtotem'), 'ID' => __('Indonesia', 'wtotem'), 'IE' => __('Ireland', 'wtotem'), 'IL' => __('Israel', 'wtotem'), 'IM' => __('Isle of Man', 'wtotem'), 'IN' => __('India', 'wtotem'), 'IO' => __('British Indian Ocean Territory', 'wtotem'), 'IQ' => __('Iraq', 'wtotem'), 'IR' => __('Iran', 'wtotem'), 'IS' => __('Iceland', 'wtotem'), 'IT' => __('Italy', 'wtotem'), 'JE' => __('Jersey', 'wtotem'), 'JM' => __('Jamaica', 'wtotem'), 'JO' => __('Jordan', 'wtotem'), 'JP' => __('Japan', 'wtotem'), 'KE' => __('Kenya', 'wtotem'), 'KG' => __('Kyrgyzstan', 'wtotem'), 'KH' => __('Cambodia', 'wtotem'), 'KI' => __('Kiribati', 'wtotem'), 'KM' => __('Comoros', 'wtotem'), 'KN' => __('St. Kitts & Nevis', 'wtotem'), 'KP' => __('North Korea', 'wtotem'), 'KR' => __('South Korea', 'wtotem'), 'KW' => __('Kuwait', 'wtotem'), 'KY' => __('Cayman Islands', 'wtotem'), 'KZ' => __('Kazakhstan', 'wtotem'), 'LA' => __('Laos', 'wtotem'), 'LB' => __('Lebanon', 'wtotem'), 'LC' => __('St. Lucia', 'wtotem'), 'LI' => __('Liechtenstein', 'wtotem'), 'LK' => __('Sri Lanka', 'wtotem'), 'LR' => __('Liberia', 'wtotem'), 'LS' => __('Lesotho', 'wtotem'), 'LT' => __('Lithuania', 'wtotem'), 'LU' => __('Luxembourg', 'wtotem'), 'LV' => __('Latvia', 'wtotem'), 'LY' => __('Libya', 'wtotem'), 'MA' => __('Morocco', 'wtotem'), 'MC' => __('Monaco', 'wtotem'), 'MD' => __('Moldova', 'wtotem'), 'ME' => __('Montenegro', 'wtotem'), 'MF' => __('St. Martin', 'wtotem'), 'MG' => __('Madagascar', 'wtotem'), 'MH' => __('Marshall Islands', 'wtotem'), 'MK' => __('North Macedonia', 'wtotem'), 'ML' => __('Mali', 'wtotem'), 'MM' => __('Myanmar (Burma)', 'wtotem'), 'MN' => __('Mongolia', 'wtotem'), 'MO' => __('Macao SAR China', 'wtotem'), 'MP' => __('Northern Mariana Islands', 'wtotem'), 'MQ' => __('Martinique', 'wtotem'), 'MR' => __('Mauritania', 'wtotem'), 'MS' => __('Montserrat', 'wtotem'), 'MT' => __('Malta', 'wtotem'), 'MU' => __('Mauritius', 'wtotem'), 'MV' => __('Maldives', 'wtotem'), 'MW' => __('Malawi', 'wtotem'), 'MX' => __('Mexico', 'wtotem'), 'MY' => __('Malaysia', 'wtotem'), 'MZ' => __('Mozambique', 'wtotem'), 'NA' => __('Namibia', 'wtotem'), 'NC' => __('New Caledonia', 'wtotem'), 'NE' => __('Niger', 'wtotem'), 'NF' => __('Norfolk Island', 'wtotem'), 'NG' => __('Nigeria', 'wtotem'), 'NI' => __('Nicaragua', 'wtotem'), 'NL' => __('Netherlands', 'wtotem'), 'NO' => __('Norway', 'wtotem'), 'NP' => __('Nepal', 'wtotem'), 'NR' => __('Nauru', 'wtotem'), 'NU' => __('Niue', 'wtotem'), 'NZ' => __('New Zealand', 'wtotem'), 'OM' => __('Oman', 'wtotem'), 'PA' => __('Panama', 'wtotem'), 'PE' => __('Peru', 'wtotem'), 'PF' => __('French Polynesia', 'wtotem'), 'PG' => __('Papua New Guinea', 'wtotem'), 'PH' => __('Philippines', 'wtotem'), 'PK' => __('Pakistan', 'wtotem'), 'PL' => __('Poland', 'wtotem'), 'PM' => __('St. Pierre & Miquelon', 'wtotem'), 'PN' => __('Pitcairn Islands', 'wtotem'), 'PR' => __('Puerto Rico', 'wtotem'), 'PS' => __('Palestinian Territories', 'wtotem'), 'PT' => __('Portugal', 'wtotem'), 'PW' => __('Palau', 'wtotem'), 'PY' => __('Paraguay', 'wtotem'), 'QA' => __('Qatar', 'wtotem'), 'QO' => __('Outlying Oceania', 'wtotem'), 'RE' => __('Réunion', 'wtotem'), 'RO' => __('Romania', 'wtotem'), 'RS' => __('Serbia', 'wtotem'), 'RU' => __('Russia', 'wtotem'), 'RW' => __('Rwanda', 'wtotem'), 'SA' => __('Saudi Arabia', 'wtotem'), 'SB' => __('Solomon Islands', 'wtotem'), 'SC' => __('Seychelles', 'wtotem'), 'SD' => __('Sudan', 'wtotem'), 'SE' => __('Sweden', 'wtotem'), 'SG' => __('Singapore', 'wtotem'), 'SH' => __('St. Helena', 'wtotem'), 'SI' => __('Slovenia', 'wtotem'), 'SJ' => __('Svalbard & Jan Mayen', 'wtotem'), 'SK' => __('Slovakia', 'wtotem'), 'SL' => __('Sierra Leone', 'wtotem'), 'SM' => __('San Marino', 'wtotem'), 'SN' => __('Senegal', 'wtotem'), 'SO' => __('Somalia', 'wtotem'), 'SR' => __('Suriname', 'wtotem'), 'SS' => __('South Sudan', 'wtotem'), 'ST' => __('São Tomé & Príncipe', 'wtotem'), 'SV' => __('El Salvador', 'wtotem'), 'SX' => __('Sint Maarten', 'wtotem'), 'SY' => __('Syria', 'wtotem'), 'SZ' => __('Eswatini', 'wtotem'), 'TA' => __('Tristan da Cunha', 'wtotem'), 'TC' => __('Turks & Caicos Islands', 'wtotem'), 'TD' => __('Chad', 'wtotem'), 'TF' => __('French Southern Territories', 'wtotem'), 'TG' => __('Togo', 'wtotem'), 'TH' => __('Thailand', 'wtotem'), 'TJ' => __('Tajikistan', 'wtotem'), 'TK' => __('Tokelau', 'wtotem'), 'TL' => __('Timor-Leste', 'wtotem'), 'TM' => __('Turkmenistan', 'wtotem'), 'TN' => __('Tunisia', 'wtotem'), 'TO' => __('Tonga', 'wtotem'), 'TR' => __('Turkey', 'wtotem'), 'TT' => __('Trinidad & Tobago', 'wtotem'), 'TV' => __('Tuvalu', 'wtotem'), 'TW' => __('Taiwan', 'wtotem'), 'TZ' => __('Tanzania', 'wtotem'), 'UA' => __('Ukraine', 'wtotem'), 'UG' => __('Uganda', 'wtotem'), 'UM' => __('U.S. Outlying Islands', 'wtotem'), 'US' => __('United States', 'wtotem'), 'UY' => __('Uruguay', 'wtotem'), 'UZ' => __('Uzbekistan', 'wtotem'), 'VA' => __('Vatican City', 'wtotem'), 'VC' => __('St. Vincent & Grenadines', 'wtotem'), 'VE' => __('Venezuela', 'wtotem'), 'VG' => __('British Virgin Islands', 'wtotem'), 'VI' => __('U.S. Virgin Islands', 'wtotem'), 'VN' => __('Vietnam', 'wtotem'), 'VU' => __('Vanuatu', 'wtotem'), 'WF' => __('Wallis & Futuna', 'wtotem'), 'WS' => __('Samoa', 'wtotem'), 'XK' => __('Kosovo', 'wtotem'), 'YE' => __('Yemen', 'wtotem'), 'YT' => __('Mayotte', 'wtotem'), 'ZA' => __('South Africa', 'wtotem'), 'ZM' => __('Zambia', 'wtotem'), 'ZW' => __('Zimbabwe', 'wtotem'), ]; // Sort the list. natcasesort($countries); return $countries; } /** * Get an array of country code => country name pairs, altered by alter hooks. * * @return array * An array of country code => country name pairs. * */ public function getList() { // Populate the country list if it is not already populated. if (!isset($this->countries)) { $this->countries = static::getStandardList(); } return $this->countries; } /** * Get an array of all two-letter country code => country name pairs. * * @return array * An array of country code => country name pairs. */ public static function getCountiesNameByCode() { $countries = [ 'AC' => "Ascension Island", 'AD' => "Andorra", 'AE' => "United Arab Emirates", 'AF' => "Afghanistan", 'AG' => "Antigua & Barbuda", 'AI' => "Anguilla", 'AL' => "Albania", 'AM' => "Armenia", 'AN' => "Netherlands Antilles", 'AO' => "Angola", 'AQ' => "Antarctica", 'AR' => "Argentina", 'AS' => "American Samoa", 'AT' => "Austria", 'AU' => "Australia", 'AW' => "Aruba", 'AX' => "Åland Islands", 'AZ' => "Azerbaijan", 'BA' => "Bosnia & Herzegovina", 'BB' => "Barbados", 'BD' => "Bangladesh", 'BE' => "Belgium", 'BF' => "Burkina Faso", 'BG' => "Bulgaria", 'BH' => "Bahrain", 'BI' => "Burundi", 'BJ' => "Benin", 'BL' => "St. Barthélemy", 'BM' => "Bermuda", 'BN' => "Brunei", 'BO' => "Bolivia", 'BQ' => "Caribbean Netherlands", 'BR' => "Brazil", 'BS' => "Bahamas", 'BT' => "Bhutan", 'BV' => "Bouvet Island", 'BW' => "Botswana", 'BY' => "Belarus", 'BZ' => "Belize", 'CA' => "Canada", 'CC' => "Cocos (Keeling) Islands", 'CD' => "Congo - Kinshasa", 'CF' => "Central African Republic", 'CG' => "Congo - Brazzaville", 'CH' => "Switzerland", 'CI' => "Côte d’Ivoire", 'CK' => "Cook Islands", 'CL' => "Chile", 'CM' => "Cameroon", 'CN' => "China", 'CO' => "Colombia", 'CP' => "Clipperton Island", 'CR' => "Costa Rica", 'CU' => "Cuba", 'CV' => "Cape Verde", 'CW' => "Curaçao", 'CX' => "Christmas Island", 'CY' => "Cyprus", 'CZ' => "Czechia", 'DE' => "Germany", 'DG' => "Diego Garcia", 'DJ' => "Djibouti", 'DK' => "Denmark", 'DM' => "Dominica", 'DO' => "Dominican Republic", 'DZ' => "Algeria", 'EA' => "Ceuta & Melilla", 'EC' => "Ecuador", 'EE' => "Estonia", 'EG' => "Egypt", 'EH' => "Western Sahara", 'ER' => "Eritrea", 'ES' => "Spain", 'ET' => "Ethiopia", 'FI' => "Finland", 'FJ' => "Fiji", 'FK' => "Falkland Islands", 'FM' => "Micronesia", 'FO' => "Faroe Islands", 'FR' => "France", 'GA' => "Gabon", 'GB' => "United Kingdom", 'GD' => "Grenada", 'GE' => "Georgia", 'GF' => "French Guiana", 'GG' => "Guernsey", 'GH' => "Ghana", 'GI' => "Gibraltar", 'GL' => "Greenland", 'GM' => "Gambia", 'GN' => "Guinea", 'GP' => "Guadeloupe", 'GQ' => "Equatorial Guinea", 'GR' => "Greece", 'GS' => "South Georgia & South Sandwich Islands", 'GT' => "Guatemala", 'GU' => "Guam", 'GW' => "Guinea-Bissau", 'GY' => "Guyana", 'HK' => "Hong Kong SAR China", 'HM' => "Heard & McDonald Islands", 'HN' => "Honduras", 'HR' => "Croatia", 'HT' => "Haiti", 'HU' => "Hungary", 'IC' => "Canary Islands", 'ID' => "Indonesia", 'IE' => "Ireland", 'IL' => "Israel", 'IM' => "Isle of Man", 'IN' => "India", 'IO' => "British Indian Ocean Territory", 'IQ' => "Iraq", 'IR' => "Iran", 'IS' => "Iceland", 'IT' => "Italy", 'JE' => "Jersey", 'JM' => "Jamaica", 'JO' => "Jordan", 'JP' => "Japan", 'KE' => "Kenya", 'KG' => "Kyrgyzstan", 'KH' => "Cambodia", 'KI' => "Kiribati", 'KM' => "Comoros", 'KN' => "St. Kitts & Nevis", 'KP' => "North Korea", 'KR' => "South Korea", 'KW' => "Kuwait", 'KY' => "Cayman Islands", 'KZ' => "Kazakhstan", 'LA' => "Laos", 'LB' => "Lebanon", 'LC' => "St. Lucia", 'LI' => "Liechtenstein", 'LK' => "Sri Lanka", 'LR' => "Liberia", 'LS' => "Lesotho", 'LT' => "Lithuania", 'LU' => "Luxembourg", 'LV' => "Latvia", 'LY' => "Libya", 'MA' => "Morocco", 'MC' => "Monaco", 'MD' => "Moldova", 'ME' => "Montenegro", 'MF' => "St. Martin", 'MG' => "Madagascar", 'MH' => "Marshall Islands", 'MK' => "North Macedonia", 'ML' => "Mali", 'MM' => "Myanmar (Burma)", 'MN' => "Mongolia", 'MO' => "Macao SAR China", 'MP' => "Northern Mariana Islands", 'MQ' => "Martinique", 'MR' => "Mauritania", 'MS' => "Montserrat", 'MT' => "Malta", 'MU' => "Mauritius", 'MV' => "Maldives", 'MW' => "Malawi", 'MX' => "Mexico", 'MY' => "Malaysia", 'MZ' => "Mozambique", 'NA' => "Namibia", 'NC' => "New Caledonia", 'NE' => "Niger", 'NF' => "Norfolk Island", 'NG' => "Nigeria", 'NI' => "Nicaragua", 'NL' => "Netherlands", 'NO' => "Norway", 'NP' => "Nepal", 'NR' => "Nauru", 'NU' => "Niue", 'NZ' => "New Zealand", 'OM' => "Oman", 'PA' => "Panama", 'PE' => "Peru", 'PF' => "French Polynesia", 'PG' => "Papua New Guinea", 'PH' => "Philippines", 'PK' => "Pakistan", 'PL' => "Poland", 'PM' => "St. Pierre & Miquelon", 'PN' => "Pitcairn Islands", 'PR' => "Puerto Rico", 'PS' => "Palestinian Territories", 'PT' => "Portugal", 'PW' => "Palau", 'PY' => "Paraguay", 'QA' => "Qatar", 'QO' => "Outlying Oceania", 'RE' => "Réunion", 'RO' => "Romania", 'RS' => "Serbia", 'RU' => "Russia", 'RW' => "Rwanda", 'SA' => "Saudi Arabia", 'SB' => "Solomon Islands", 'SC' => "Seychelles", 'SD' => "Sudan", 'SE' => "Sweden", 'SG' => "Singapore", 'SH' => "St. Helena", 'SI' => "Slovenia", 'SJ' => "Svalbard & Jan Mayen", 'SK' => "Slovakia", 'SL' => "Sierra Leone", 'SM' => "San Marino", 'SN' => "Senegal", 'SO' => "Somalia", 'SR' => "Suriname", 'SS' => "South Sudan", 'ST' => "São Tomé & Príncipe", 'SV' => "El Salvador", 'SX' => "Sint Maarten", 'SY' => "Syria", 'SZ' => "Eswatini", 'TA' => "Tristan da Cunha", 'TC' => "Turks & Caicos Islands", 'TD' => "Chad", 'TF' => "French Southern Territories", 'TG' => "Togo", 'TH' => "Thailand", 'TJ' => "Tajikistan", 'TK' => "Tokelau", 'TL' => "Timor-Leste", 'TM' => "Turkmenistan", 'TN' => "Tunisia", 'TO' => "Tonga", 'TR' => "Turkey", 'TT' => "Trinidad & Tobago", 'TV' => "Tuvalu", 'TW' => "Taiwan", 'TZ' => "Tanzania", 'UA' => "Ukraine", 'UG' => "Uganda", 'UM' => "U.S. Outlying Islands", 'US' => "United States", 'UY' => "Uruguay", 'UZ' => "Uzbekistan", 'VA' => "Vatican City", 'VC' => "St. Vincent & Grenadines", 'VE' => "Venezuela", 'VG' => "British Virgin Islands", 'VI' => "U.S. Virgin Islands", 'VN' => "Vietnam", 'VU' => "Vanuatu", 'WF' => "Wallis & Futuna", 'WS' => "Samoa", 'XK' => "Kosovo", 'YE' => "Yemen", 'YT' => "Mayotte", 'ZA' => "South Africa", 'ZM' => "Zambia", 'ZW' => "Zimbabwe", ]; // Sort the list. natcasesort($countries); return $countries; } }