Skip to content

Instantly share code, notes, and snippets.

@sandeepgill
Created January 7, 2019 19:05
Show Gist options
  • Save sandeepgill/abe0bed9db7e5f566d9a6e1b805d9f5b to your computer and use it in GitHub Desktop.
Save sandeepgill/abe0bed9db7e5f566d9a6e1b805d9f5b to your computer and use it in GitHub Desktop.
Country list with ISO2, Capitals, ISO3, Phone and Currency
<?php
class Country
{
public static $countries = [
'BD' =>
[
'name' => "Bangladesh",
'ISO3' => "BGD",
'capital' => "Dhaka",
'phone' => "880",
'currency' => "BDT",
],
'BE' =>
[
'name' => "Belgium",
'ISO3' => "BEL",
'capital' => "Brussels",
'phone' => "32",
'currency' => "EUR",
],
'BF' =>
[
'name' => "Burkina Faso",
'ISO3' => "BFA",
'capital' => "Ouagadougou",
'phone' => "226",
'currency' => "XOF",
],
'BG' =>
[
'name' => "Bulgaria",
'ISO3' => "BGR",
'capital' => "Sofia",
'phone' => "359",
'currency' => "BGN",
],
'BA' =>
[
'name' => "Bosnia and Herzegovina",
'ISO3' => "BIH",
'capital' => "Sarajevo",
'phone' => "387",
'currency' => "BAM",
],
'BB' =>
[
'name' => "Barbados",
'ISO3' => "BRB",
'capital' => "Bridgetown",
'phone' => "+1-246",
'currency' => "BBD",
],
'WF' =>
[
'name' => "Wallis and Futuna",
'ISO3' => "WLF",
'capital' => "Mata Utu",
'phone' => "681",
'currency' => "XPF",
],
'BL' =>
[
'name' => "Saint Barthelemy",
'ISO3' => "BLM",
'capital' => "Gustavia",
'phone' => "590",
'currency' => "EUR",
],
'BM' =>
[
'name' => "Bermuda",
'ISO3' => "BMU",
'capital' => "Hamilton",
'phone' => "+1-441",
'currency' => "BMD",
],
'BN' =>
[
'name' => "Brunei",
'ISO3' => "BRN",
'capital' => "Bandar Seri Begawan",
'phone' => "673",
'currency' => "BND",
],
'BO' =>
[
'name' => "Bolivia",
'ISO3' => "BOL",
'capital' => "Sucre",
'phone' => "591",
'currency' => "BOB",
],
'BH' =>
[
'name' => "Bahrain",
'ISO3' => "BHR",
'capital' => "Manama",
'phone' => "973",
'currency' => "BHD",
],
'BI' =>
[
'name' => "Burundi",
'ISO3' => "BDI",
'capital' => "Bujumbura",
'phone' => "257",
'currency' => "BIF",
],
'BJ' =>
[
'name' => "Benin",
'ISO3' => "BEN",
'capital' => "Porto-Novo",
'phone' => "229",
'currency' => "XOF",
],
'BT' =>
[
'name' => "Bhutan",
'ISO3' => "BTN",
'capital' => "Thimphu",
'phone' => "975",
'currency' => "BTN",
],
'JM' =>
[
'name' => "Jamaica",
'ISO3' => "JAM",
'capital' => "Kingston",
'phone' => "+1-876",
'currency' => "JMD",
],
'BV' =>
[
'name' => "Bouvet Island",
'ISO3' => "BVT",
'capital' => "",
'phone' => "",
'currency' => "NOK",
],
'BW' =>
[
'name' => "Botswana",
'ISO3' => "BWA",
'capital' => "Gaborone",
'phone' => "267",
'currency' => "BWP",
],
'WS' =>
[
'name' => "Samoa",
'ISO3' => "WSM",
'capital' => "Apia",
'phone' => "685",
'currency' => "WST",
],
'BQ' =>
[
'name' => "Bonaire, Saint Eustatius and Saba ",
'ISO3' => "BES",
'capital' => "",
'phone' => "599",
'currency' => "USD",
],
'BR' =>
[
'name' => "Brazil",
'ISO3' => "BRA",
'capital' => "Brasilia",
'phone' => "55",
'currency' => "BRL",
],
'BS' =>
[
'name' => "Bahamas",
'ISO3' => "BHS",
'capital' => "Nassau",
'phone' => "+1-242",
'currency' => "BSD",
],
'JE' =>
[
'name' => "Jersey",
'ISO3' => "JEY",
'capital' => "Saint Helier",
'phone' => "+44-1534",
'currency' => "GBP",
],
'BY' =>
[
'name' => "Belarus",
'ISO3' => "BLR",
'capital' => "Minsk",
'phone' => "375",
'currency' => "BYR",
],
'BZ' =>
[
'name' => "Belize",
'ISO3' => "BLZ",
'capital' => "Belmopan",
'phone' => "501",
'currency' => "BZD",
],
'RU' =>
[
'name' => "Russia",
'ISO3' => "RUS",
'capital' => "Moscow",
'phone' => "7",
'currency' => "RUB",
],
'RW' =>
[
'name' => "Rwanda",
'ISO3' => "RWA",
'capital' => "Kigali",
'phone' => "250",
'currency' => "RWF",
],
'RS' =>
[
'name' => "Serbia",
'ISO3' => "SRB",
'capital' => "Belgrade",
'phone' => "381",
'currency' => "RSD",
],
'TL' =>
[
'name' => "East Timor",
'ISO3' => "TLS",
'capital' => "Dili",
'phone' => "670",
'currency' => "USD",
],
'RE' =>
[
'name' => "Reunion",
'ISO3' => "REU",
'capital' => "Saint-Denis",
'phone' => "262",
'currency' => "EUR",
],
'TM' =>
[
'name' => "Turkmenistan",
'ISO3' => "TKM",
'capital' => "Ashgabat",
'phone' => "993",
'currency' => "TMT",
],
'TJ' =>
[
'name' => "Tajikistan",
'ISO3' => "TJK",
'capital' => "Dushanbe",
'phone' => "992",
'currency' => "TJS",
],
'RO' =>
[
'name' => "Romania",
'ISO3' => "ROU",
'capital' => "Bucharest",
'phone' => "40",
'currency' => "RON",
],
'TK' =>
[
'name' => "Tokelau",
'ISO3' => "TKL",
'capital' => "",
'phone' => "690",
'currency' => "NZD",
],
'GW' =>
[
'name' => "Guinea-Bissau",
'ISO3' => "GNB",
'capital' => "Bissau",
'phone' => "245",
'currency' => "XOF",
],
'GU' =>
[
'name' => "Guam",
'ISO3' => "GUM",
'capital' => "Hagatna",
'phone' => "+1-671",
'currency' => "USD",
],
'GT' =>
[
'name' => "Guatemala",
'ISO3' => "GTM",
'capital' => "Guatemala City",
'phone' => "502",
'currency' => "GTQ",
],
'GS' =>
[
'name' => "South Georgia and the South Sandwich Islands",
'ISO3' => "SGS",
'capital' => "Grytviken",
'phone' => "",
'currency' => "GBP",
],
'GR' =>
[
'name' => "Greece",
'ISO3' => "GRC",
'capital' => "Athens",
'phone' => "30",
'currency' => "EUR",
],
'GQ' =>
[
'name' => "Equatorial Guinea",
'ISO3' => "GNQ",
'capital' => "Malabo",
'phone' => "240",
'currency' => "XAF",
],
'GP' =>
[
'name' => "Guadeloupe",
'ISO3' => "GLP",
'capital' => "Basse-Terre",
'phone' => "590",
'currency' => "EUR",
],
'JP' =>
[
'name' => "Japan",
'ISO3' => "JPN",
'capital' => "Tokyo",
'phone' => "81",
'currency' => "JPY",
],
'GY' =>
[
'name' => "Guyana",
'ISO3' => "GUY",
'capital' => "Georgetown",
'phone' => "592",
'currency' => "GYD",
],
'GG' =>
[
'name' => "Guernsey",
'ISO3' => "GGY",
'capital' => "St Peter Port",
'phone' => "+44-1481",
'currency' => "GBP",
],
'GF' =>
[
'name' => "French Guiana",
'ISO3' => "GUF",
'capital' => "Cayenne",
'phone' => "594",
'currency' => "EUR",
],
'GE' =>
[
'name' => "Georgia",
'ISO3' => "GEO",
'capital' => "Tbilisi",
'phone' => "995",
'currency' => "GEL",
],
'GD' =>
[
'name' => "Grenada",
'ISO3' => "GRD",
'capital' => "St. George's",
'phone' => "+1-473",
'currency' => "XCD",
],
'GB' =>
[
'name' => "United Kingdom",
'ISO3' => "GBR",
'capital' => "London",
'phone' => "44",
'currency' => "GBP",
],
'GA' =>
[
'name' => "Gabon",
'ISO3' => "GAB",
'capital' => "Libreville",
'phone' => "241",
'currency' => "XAF",
],
'SV' =>
[
'name' => "El Salvador",
'ISO3' => "SLV",
'capital' => "San Salvador",
'phone' => "503",
'currency' => "USD",
],
'GN' =>
[
'name' => "Guinea",
'ISO3' => "GIN",
'capital' => "Conakry",
'phone' => "224",
'currency' => "GNF",
],
'GM' =>
[
'name' => "Gambia",
'ISO3' => "GMB",
'capital' => "Banjul",
'phone' => "220",
'currency' => "GMD",
],
'GL' =>
[
'name' => "Greenland",
'ISO3' => "GRL",
'capital' => "Nuuk",
'phone' => "299",
'currency' => "DKK",
],
'GI' =>
[
'name' => "Gibraltar",
'ISO3' => "GIB",
'capital' => "Gibraltar",
'phone' => "350",
'currency' => "GIP",
],
'GH' =>
[
'name' => "Ghana",
'ISO3' => "GHA",
'capital' => "Accra",
'phone' => "233",
'currency' => "GHS",
],
'OM' =>
[
'name' => "Oman",
'ISO3' => "OMN",
'capital' => "Muscat",
'phone' => "968",
'currency' => "OMR",
],
'TN' =>
[
'name' => "Tunisia",
'ISO3' => "TUN",
'capital' => "Tunis",
'phone' => "216",
'currency' => "TND",
],
'JO' =>
[
'name' => "Jordan",
'ISO3' => "JOR",
'capital' => "Amman",
'phone' => "962",
'currency' => "JOD",
],
'HR' =>
[
'name' => "Croatia",
'ISO3' => "HRV",
'capital' => "Zagreb",
'phone' => "385",
'currency' => "HRK",
],
'HT' =>
[
'name' => "Haiti",
'ISO3' => "HTI",
'capital' => "Port-au-Prince",
'phone' => "509",
'currency' => "HTG",
],
'HU' =>
[
'name' => "Hungary",
'ISO3' => "HUN",
'capital' => "Budapest",
'phone' => "36",
'currency' => "HUF",
],
'HK' =>
[
'name' => "Hong Kong",
'ISO3' => "HKG",
'capital' => "Hong Kong",
'phone' => "852",
'currency' => "HKD",
],
'HN' =>
[
'name' => "Honduras",
'ISO3' => "HND",
'capital' => "Tegucigalpa",
'phone' => "504",
'currency' => "HNL",
],
'HM' =>
[
'name' => "Heard Island and McDonald Islands",
'ISO3' => "HMD",
'capital' => "",
'phone' => " ",
'currency' => "AUD",
],
'VE' =>
[
'name' => "Venezuela",
'ISO3' => "VEN",
'capital' => "Caracas",
'phone' => "58",
'currency' => "VEF",
],
'PR' =>
[
'name' => "Puerto Rico",
'ISO3' => "PRI",
'capital' => "San Juan",
'phone' => "+1-787 and 1-939",
'currency' => "USD",
],
'PS' =>
[
'name' => "Palestinian Territory",
'ISO3' => "PSE",
'capital' => "East Jerusalem",
'phone' => "970",
'currency' => "ILS",
],
'PW' =>
[
'name' => "Palau",
'ISO3' => "PLW",
'capital' => "Melekeok",
'phone' => "680",
'currency' => "USD",
],
'PT' =>
[
'name' => "Portugal",
'ISO3' => "PRT",
'capital' => "Lisbon",
'phone' => "351",
'currency' => "EUR",
],
'SJ' =>
[
'name' => "Svalbard and Jan Mayen",
'ISO3' => "SJM",
'capital' => "Longyearbyen",
'phone' => "47",
'currency' => "NOK",
],
'PY' =>
[
'name' => "Paraguay",
'ISO3' => "PRY",
'capital' => "Asuncion",
'phone' => "595",
'currency' => "PYG",
],
'IQ' =>
[
'name' => "Iraq",
'ISO3' => "IRQ",
'capital' => "Baghdad",
'phone' => "964",
'currency' => "IQD",
],
'PA' =>
[
'name' => "Panama",
'ISO3' => "PAN",
'capital' => "Panama City",
'phone' => "507",
'currency' => "PAB",
],
'PF' =>
[
'name' => "French Polynesia",
'ISO3' => "PYF",
'capital' => "Papeete",
'phone' => "689",
'currency' => "XPF",
],
'PG' =>
[
'name' => "Papua New Guinea",
'ISO3' => "PNG",
'capital' => "Port Moresby",
'phone' => "675",
'currency' => "PGK",
],
'PE' =>
[
'name' => "Peru",
'ISO3' => "PER",
'capital' => "Lima",
'phone' => "51",
'currency' => "PEN",
],
'PK' =>
[
'name' => "Pakistan",
'ISO3' => "PAK",
'capital' => "Islamabad",
'phone' => "92",
'currency' => "PKR",
],
'PH' =>
[
'name' => "Philippines",
'ISO3' => "PHL",
'capital' => "Manila",
'phone' => "63",
'currency' => "PHP",
],
'PN' =>
[
'name' => "Pitcairn",
'ISO3' => "PCN",
'capital' => "Adamstown",
'phone' => "870",
'currency' => "NZD",
],
'PL' =>
[
'name' => "Poland",
'ISO3' => "POL",
'capital' => "Warsaw",
'phone' => "48",
'currency' => "PLN",
],
'PM' =>
[
'name' => "Saint Pierre and Miquelon",
'ISO3' => "SPM",
'capital' => "Saint-Pierre",
'phone' => "508",
'currency' => "EUR",
],
'ZM' =>
[
'name' => "Zambia",
'ISO3' => "ZMB",
'capital' => "Lusaka",
'phone' => "260",
'currency' => "ZMK",
],
'EH' =>
[
'name' => "Western Sahara",
'ISO3' => "ESH",
'capital' => "El-Aaiun",
'phone' => "212",
'currency' => "MAD",
],
'EE' =>
[
'name' => "Estonia",
'ISO3' => "EST",
'capital' => "Tallinn",
'phone' => "372",
'currency' => "EUR",
],
'EG' =>
[
'name' => "Egypt",
'ISO3' => "EGY",
'capital' => "Cairo",
'phone' => "20",
'currency' => "EGP",
],
'ZA' =>
[
'name' => "South Africa",
'ISO3' => "ZAF",
'capital' => "Pretoria",
'phone' => "27",
'currency' => "ZAR",
],
'EC' =>
[
'name' => "Ecuador",
'ISO3' => "ECU",
'capital' => "Quito",
'phone' => "593",
'currency' => "USD",
],
'IT' =>
[
'name' => "Italy",
'ISO3' => "ITA",
'capital' => "Rome",
'phone' => "39",
'currency' => "EUR",
],
'VN' =>
[
'name' => "Vietnam",
'ISO3' => "VNM",
'capital' => "Hanoi",
'phone' => "84",
'currency' => "VND",
],
'SB' =>
[
'name' => "Solomon Islands",
'ISO3' => "SLB",
'capital' => "Honiara",
'phone' => "677",
'currency' => "SBD",
],
'ET' =>
[
'name' => "Ethiopia",
'ISO3' => "ETH",
'capital' => "Addis Ababa",
'phone' => "251",
'currency' => "ETB",
],
'SO' =>
[
'name' => "Somalia",
'ISO3' => "SOM",
'capital' => "Mogadishu",
'phone' => "252",
'currency' => "SOS",
],
'ZW' =>
[
'name' => "Zimbabwe",
'ISO3' => "ZWE",
'capital' => "Harare",
'phone' => "263",
'currency' => "ZWL",
],
'SA' =>
[
'name' => "Saudi Arabia",
'ISO3' => "SAU",
'capital' => "Riyadh",
'phone' => "966",
'currency' => "SAR",
],
'ES' =>
[
'name' => "Spain",
'ISO3' => "ESP",
'capital' => "Madrid",
'phone' => "34",
'currency' => "EUR",
],
'ER' =>
[
'name' => "Eritrea",
'ISO3' => "ERI",
'capital' => "Asmara",
'phone' => "291",
'currency' => "ERN",
],
'ME' =>
[
'name' => "Montenegro",
'ISO3' => "MNE",
'capital' => "Podgorica",
'phone' => "382",
'currency' => "EUR",
],
'MD' =>
[
'name' => "Moldova",
'ISO3' => "MDA",
'capital' => "Chisinau",
'phone' => "373",
'currency' => "MDL",
],
'MG' =>
[
'name' => "Madagascar",
'ISO3' => "MDG",
'capital' => "Antananarivo",
'phone' => "261",
'currency' => "MGA",
],
'MF' =>
[
'name' => "Saint Martin",
'ISO3' => "MAF",
'capital' => "Marigot",
'phone' => "590",
'currency' => "EUR",
],
'MA' =>
[
'name' => "Morocco",
'ISO3' => "MAR",
'capital' => "Rabat",
'phone' => "212",
'currency' => "MAD",
],
'MC' =>
[
'name' => "Monaco",
'ISO3' => "MCO",
'capital' => "Monaco",
'phone' => "377",
'currency' => "EUR",
],
'UZ' =>
[
'name' => "Uzbekistan",
'ISO3' => "UZB",
'capital' => "Tashkent",
'phone' => "998",
'currency' => "UZS",
],
'MM' =>
[
'name' => "Myanmar",
'ISO3' => "MMR",
'capital' => "Nay Pyi Taw",
'phone' => "95",
'currency' => "MMK",
],
'ML' =>
[
'name' => "Mali",
'ISO3' => "MLI",
'capital' => "Bamako",
'phone' => "223",
'currency' => "XOF",
],
'MO' =>
[
'name' => "Macao",
'ISO3' => "MAC",
'capital' => "Macao",
'phone' => "853",
'currency' => "MOP",
],
'MN' =>
[
'name' => "Mongolia",
'ISO3' => "MNG",
'capital' => "Ulan Bator",
'phone' => "976",
'currency' => "MNT",
],
'MH' =>
[
'name' => "Marshall Islands",
'ISO3' => "MHL",
'capital' => "Majuro",
'phone' => "692",
'currency' => "USD",
],
'MK' =>
[
'name' => "Macedonia",
'ISO3' => "MKD",
'capital' => "Skopje",
'phone' => "389",
'currency' => "MKD",
],
'MU' =>
[
'name' => "Mauritius",
'ISO3' => "MUS",
'capital' => "Port Louis",
'phone' => "230",
'currency' => "MUR",
],
'MT' =>
[
'name' => "Malta",
'ISO3' => "MLT",
'capital' => "Valletta",
'phone' => "356",
'currency' => "EUR",
],
'MW' =>
[
'name' => "Malawi",
'ISO3' => "MWI",
'capital' => "Lilongwe",
'phone' => "265",
'currency' => "MWK",
],
'MV' =>
[
'name' => "Maldives",
'ISO3' => "MDV",
'capital' => "Male",
'phone' => "960",
'currency' => "MVR",
],
'MQ' =>
[
'name' => "Martinique",
'ISO3' => "MTQ",
'capital' => "Fort-de-France",
'phone' => "596",
'currency' => "EUR",
],
'MP' =>
[
'name' => "Northern Mariana Islands",
'ISO3' => "MNP",
'capital' => "Saipan",
'phone' => "+1-670",
'currency' => "USD",
],
'MS' =>
[
'name' => "Montserrat",
'ISO3' => "MSR",
'capital' => "Plymouth",
'phone' => "+1-664",
'currency' => "XCD",
],
'MR' =>
[
'name' => "Mauritania",
'ISO3' => "MRT",
'capital' => "Nouakchott",
'phone' => "222",
'currency' => "MRO",
],
'IM' =>
[
'name' => "Isle of Man",
'ISO3' => "IMN",
'capital' => "Douglas, Isle of Man",
'phone' => "+44-1624",
'currency' => "GBP",
],
'UG' =>
[
'name' => "Uganda",
'ISO3' => "UGA",
'capital' => "Kampala",
'phone' => "256",
'currency' => "UGX",
],
'TZ' =>
[
'name' => "Tanzania",
'ISO3' => "TZA",
'capital' => "Dodoma",
'phone' => "255",
'currency' => "TZS",
],
'MY' =>
[
'name' => "Malaysia",
'ISO3' => "MYS",
'capital' => "Kuala Lumpur",
'phone' => "60",
'currency' => "MYR",
],
'MX' =>
[
'name' => "Mexico",
'ISO3' => "MEX",
'capital' => "Mexico City",
'phone' => "52",
'currency' => "MXN",
],
'IL' =>
[
'name' => "Israel",
'ISO3' => "ISR",
'capital' => "Jerusalem",
'phone' => "972",
'currency' => "ILS",
],
'FR' =>
[
'name' => "France",
'ISO3' => "FRA",
'capital' => "Paris",
'phone' => "33",
'currency' => "EUR",
],
'IO' =>
[
'name' => "British Indian Ocean Territory",
'ISO3' => "IOT",
'capital' => "Diego Garcia",
'phone' => "246",
'currency' => "USD",
],
'SH' =>
[
'name' => "Saint Helena",
'ISO3' => "SHN",
'capital' => "Jamestown",
'phone' => "290",
'currency' => "SHP",
],
'FI' =>
[
'name' => "Finland",
'ISO3' => "FIN",
'capital' => "Helsinki",
'phone' => "358",
'currency' => "EUR",
],
'FJ' =>
[
'name' => "Fiji",
'ISO3' => "FJI",
'capital' => "Suva",
'phone' => "679",
'currency' => "FJD",
],
'FK' =>
[
'name' => "Falkland Islands",
'ISO3' => "FLK",
'capital' => "Stanley",
'phone' => "500",
'currency' => "FKP",
],
'FM' =>
[
'name' => "Micronesia",
'ISO3' => "FSM",
'capital' => "Palikir",
'phone' => "691",
'currency' => "USD",
],
'FO' =>
[
'name' => "Faroe Islands",
'ISO3' => "FRO",
'capital' => "Torshavn",
'phone' => "298",
'currency' => "DKK",
],
'NI' =>
[
'name' => "Nicaragua",
'ISO3' => "NIC",
'capital' => "Managua",
'phone' => "505",
'currency' => "NIO",
],
'NL' =>
[
'name' => "Netherlands",
'ISO3' => "NLD",
'capital' => "Amsterdam",
'phone' => "31",
'currency' => "EUR",
],
'NO' =>
[
'name' => "Norway",
'ISO3' => "NOR",
'capital' => "Oslo",
'phone' => "47",
'currency' => "NOK",
],
'NA' =>
[
'name' => "Namibia",
'ISO3' => "NAM",
'capital' => "Windhoek",
'phone' => "264",
'currency' => "NAD",
],
'VU' =>
[
'name' => "Vanuatu",
'ISO3' => "VUT",
'capital' => "Port Vila",
'phone' => "678",
'currency' => "VUV",
],
'NC' =>
[
'name' => "New Caledonia",
'ISO3' => "NCL",
'capital' => "Noumea",
'phone' => "687",
'currency' => "XPF",
],
'NE' =>
[
'name' => "Niger",
'ISO3' => "NER",
'capital' => "Niamey",
'phone' => "227",
'currency' => "XOF",
],
'NF' =>
[
'name' => "Norfolk Island",
'ISO3' => "NFK",
'capital' => "Kingston",
'phone' => "672",
'currency' => "AUD",
],
'NG' =>
[
'name' => "Nigeria",
'ISO3' => "NGA",
'capital' => "Abuja",
'phone' => "234",
'currency' => "NGN",
],
'NZ' =>
[
'name' => "New Zealand",
'ISO3' => "NZL",
'capital' => "Wellington",
'phone' => "64",
'currency' => "NZD",
],
'NP' =>
[
'name' => "Nepal",
'ISO3' => "NPL",
'capital' => "Kathmandu",
'phone' => "977",
'currency' => "NPR",
],
'NR' =>
[
'name' => "Nauru",
'ISO3' => "NRU",
'capital' => "Yaren",
'phone' => "674",
'currency' => "AUD",
],
'NU' =>
[
'name' => "Niue",
'ISO3' => "NIU",
'capital' => "Alofi",
'phone' => "683",
'currency' => "NZD",
],
'CK' =>
[
'name' => "Cook Islands",
'ISO3' => "COK",
'capital' => "Avarua",
'phone' => "682",
'currency' => "NZD",
],
'XK' =>
[
'name' => "Kosovo",
'ISO3' => "XKX",
'capital' => "Pristina",
'phone' => "",
'currency' => "EUR",
],
'CI' =>
[
'name' => "Ivory Coast",
'ISO3' => "CIV",
'capital' => "Yamoussoukro",
'phone' => "225",
'currency' => "XOF",
],
'CH' =>
[
'name' => "Switzerland",
'ISO3' => "CHE",
'capital' => "Berne",
'phone' => "41",
'currency' => "CHF",
],
'CO' =>
[
'name' => "Colombia",
'ISO3' => "COL",
'capital' => "Bogota",
'phone' => "57",
'currency' => "COP",
],
'CN' =>
[
'name' => "China",
'ISO3' => "CHN",
'capital' => "Beijing",
'phone' => "86",
'currency' => "CNY",
],
'CM' =>
[
'name' => "Cameroon",
'ISO3' => "CMR",
'capital' => "Yaounde",
'phone' => "237",
'currency' => "XAF",
],
'CL' =>
[
'name' => "Chile",
'ISO3' => "CHL",
'capital' => "Santiago",
'phone' => "56",
'currency' => "CLP",
],
'CC' =>
[
'name' => "Cocos Islands",
'ISO3' => "CCK",
'capital' => "West Island",
'phone' => "61",
'currency' => "AUD",
],
'CA' =>
[
'name' => "Canada",
'ISO3' => "CAN",
'capital' => "Ottawa",
'phone' => "1",
'currency' => "CAD",
],
'CG' =>
[
'name' => "Republic of the Congo",
'ISO3' => "COG",
'capital' => "Brazzaville",
'phone' => "242",
'currency' => "XAF",
],
'CF' =>
[
'name' => "Central African Republic",
'ISO3' => "CAF",
'capital' => "Bangui",
'phone' => "236",
'currency' => "XAF",
],
'CD' =>
[
'name' => "Democratic Republic of the Congo",
'ISO3' => "COD",
'capital' => "Kinshasa",
'phone' => "243",
'currency' => "CDF",
],
'CZ' =>
[
'name' => "Czech Republic",
'ISO3' => "CZE",
'capital' => "Prague",
'phone' => "420",
'currency' => "CZK",
],
'CY' =>
[
'name' => "Cyprus",
'ISO3' => "CYP",
'capital' => "Nicosia",
'phone' => "357",
'currency' => "EUR",
],
'CX' =>
[
'name' => "Christmas Island",
'ISO3' => "CXR",
'capital' => "Flying Fish Cove",
'phone' => "61",
'currency' => "AUD",
],
'CR' =>
[
'name' => "Costa Rica",
'ISO3' => "CRI",
'capital' => "San Jose",
'phone' => "506",
'currency' => "CRC",
],
'CW' =>
[
'name' => "Curacao",
'ISO3' => "CUW",
'capital' => " Willemstad",
'phone' => "599",
'currency' => "ANG",
],
'CV' =>
[
'name' => "Cape Verde",
'ISO3' => "CPV",
'capital' => "Praia",
'phone' => "238",
'currency' => "CVE",
],
'CU' =>
[
'name' => "Cuba",
'ISO3' => "CUB",
'capital' => "Havana",
'phone' => "53",
'currency' => "CUP",
],
'SZ' =>
[
'name' => "Swaziland",
'ISO3' => "SWZ",
'capital' => "Mbabane",
'phone' => "268",
'currency' => "SZL",
],
'SY' =>
[
'name' => "Syria",
'ISO3' => "SYR",
'capital' => "Damascus",
'phone' => "963",
'currency' => "SYP",
],
'SX' =>
[
'name' => "Sint Maarten",
'ISO3' => "SXM",
'capital' => "Philipsburg",
'phone' => "599",
'currency' => "ANG",
],
'KG' =>
[
'name' => "Kyrgyzstan",
'ISO3' => "KGZ",
'capital' => "Bishkek",
'phone' => "996",
'currency' => "KGS",
],
'KE' =>
[
'name' => "Kenya",
'ISO3' => "KEN",
'capital' => "Nairobi",
'phone' => "254",
'currency' => "KES",
],
'SS' =>
[
'name' => "South Sudan",
'ISO3' => "SSD",
'capital' => "Juba",
'phone' => "211",
'currency' => "SSP",
],
'SR' =>
[
'name' => "Suriname",
'ISO3' => "SUR",
'capital' => "Paramaribo",
'phone' => "597",
'currency' => "SRD",
],
'KI' =>
[
'name' => "Kiribati",
'ISO3' => "KIR",
'capital' => "Tarawa",
'phone' => "686",
'currency' => "AUD",
],
'KH' =>
[
'name' => "Cambodia",
'ISO3' => "KHM",
'capital' => "Phnom Penh",
'phone' => "855",
'currency' => "KHR",
],
'KN' =>
[
'name' => "Saint Kitts and Nevis",
'ISO3' => "KNA",
'capital' => "Basseterre",
'phone' => "+1-869",
'currency' => "XCD",
],
'KM' =>
[
'name' => "Comoros",
'ISO3' => "COM",
'capital' => "Moroni",
'phone' => "269",
'currency' => "KMF",
],
'ST' =>
[
'name' => "Sao Tome and Principe",
'ISO3' => "STP",
'capital' => "Sao Tome",
'phone' => "239",
'currency' => "STD",
],
'SK' =>
[
'name' => "Slovakia",
'ISO3' => "SVK",
'capital' => "Bratislava",
'phone' => "421",
'currency' => "EUR",
],
'KR' =>
[
'name' => "South Korea",
'ISO3' => "KOR",
'capital' => "Seoul",
'phone' => "82",
'currency' => "KRW",
],
'SI' =>
[
'name' => "Slovenia",
'ISO3' => "SVN",
'capital' => "Ljubljana",
'phone' => "386",
'currency' => "EUR",
],
'KP' =>
[
'name' => "North Korea",
'ISO3' => "PRK",
'capital' => "Pyongyang",
'phone' => "850",
'currency' => "KPW",
],
'KW' =>
[
'name' => "Kuwait",
'ISO3' => "KWT",
'capital' => "Kuwait City",
'phone' => "965",
'currency' => "KWD",
],
'SN' =>
[
'name' => "Senegal",
'ISO3' => "SEN",
'capital' => "Dakar",
'phone' => "221",
'currency' => "XOF",
],
'SM' =>
[
'name' => "San Marino",
'ISO3' => "SMR",
'capital' => "San Marino",
'phone' => "378",
'currency' => "EUR",
],
'SL' =>
[
'name' => "Sierra Leone",
'ISO3' => "SLE",
'capital' => "Freetown",
'phone' => "232",
'currency' => "SLL",
],
'SC' =>
[
'name' => "Seychelles",
'ISO3' => "SYC",
'capital' => "Victoria",
'phone' => "248",
'currency' => "SCR",
],
'KZ' =>
[
'name' => "Kazakhstan",
'ISO3' => "KAZ",
'capital' => "Astana",
'phone' => "7",
'currency' => "KZT",
],
'KY' =>
[
'name' => "Cayman Islands",
'ISO3' => "CYM",
'capital' => "George Town",
'phone' => "+1-345",
'currency' => "KYD",
],
'SG' =>
[
'name' => "Singapore",
'ISO3' => "SGP",
'capital' => "Singapur",
'phone' => "65",
'currency' => "SGD",
],
'SE' =>
[
'name' => "Sweden",
'ISO3' => "SWE",
'capital' => "Stockholm",
'phone' => "46",
'currency' => "SEK",
],
'SD' =>
[
'name' => "Sudan",
'ISO3' => "SDN",
'capital' => "Khartoum",
'phone' => "249",
'currency' => "SDG",
],
'DO' =>
[
'name' => "Dominican Republic",
'ISO3' => "DOM",
'capital' => "Santo Domingo",
'phone' => "+1-809 and 1-829",
'currency' => "DOP",
],
'DM' =>
[
'name' => "Dominica",
'ISO3' => "DMA",
'capital' => "Roseau",
'phone' => "+1-767",
'currency' => "XCD",
],
'DJ' =>
[
'name' => "Djibouti",
'ISO3' => "DJI",
'capital' => "Djibouti",
'phone' => "253",
'currency' => "DJF",
],
'DK' =>
[
'name' => "Denmark",
'ISO3' => "DNK",
'capital' => "Copenhagen",
'phone' => "45",
'currency' => "DKK",
],
'VG' =>
[
'name' => "British Virgin Islands",
'ISO3' => "VGB",
'capital' => "Road Town",
'phone' => "+1-284",
'currency' => "USD",
],
'DE' =>
[
'name' => "Germany",
'ISO3' => "DEU",
'capital' => "Berlin",
'phone' => "49",
'currency' => "EUR",
],
'YE' =>
[
'name' => "Yemen",
'ISO3' => "YEM",
'capital' => "Sanaa",
'phone' => "967",
'currency' => "YER",
],
'DZ' =>
[
'name' => "Algeria",
'ISO3' => "DZA",
'capital' => "Algiers",
'phone' => "213",
'currency' => "DZD",
],
'US' =>
[
'name' => "United States",
'ISO3' => "USA",
'capital' => "Washington",
'phone' => "1",
'currency' => "USD",
],
'UY' =>
[
'name' => "Uruguay",
'ISO3' => "URY",
'capital' => "Montevideo",
'phone' => "598",
'currency' => "UYU",
],
'YT' =>
[
'name' => "Mayotte",
'ISO3' => "MYT",
'capital' => "Mamoudzou",
'phone' => "262",
'currency' => "EUR",
],
'UM' =>
[
'name' => "United States Minor Outlying Islands",
'ISO3' => "UMI",
'capital' => "",
'phone' => "1",
'currency' => "USD",
],
'LB' =>
[
'name' => "Lebanon",
'ISO3' => "LBN",
'capital' => "Beirut",
'phone' => "961",
'currency' => "LBP",
],
'LC' =>
[
'name' => "Saint Lucia",
'ISO3' => "LCA",
'capital' => "Castries",
'phone' => "+1-758",
'currency' => "XCD",
],
'LA' =>
[
'name' => "Laos",
'ISO3' => "LAO",
'capital' => "Vientiane",
'phone' => "856",
'currency' => "LAK",
],
'TV' =>
[
'name' => "Tuvalu",
'ISO3' => "TUV",
'capital' => "Funafuti",
'phone' => "688",
'currency' => "AUD",
],
'TW' =>
[
'name' => "Taiwan",
'ISO3' => "TWN",
'capital' => "Taipei",
'phone' => "886",
'currency' => "TWD",
],
'TT' =>
[
'name' => "Trinidad and Tobago",
'ISO3' => "TTO",
'capital' => "Port of Spain",
'phone' => "+1-868",
'currency' => "TTD",
],
'TR' =>
[
'name' => "Turkey",
'ISO3' => "TUR",
'capital' => "Ankara",
'phone' => "90",
'currency' => "TRY",
],
'LK' =>
[
'name' => "Sri Lanka",
'ISO3' => "LKA",
'capital' => "Colombo",
'phone' => "94",
'currency' => "LKR",
],
'LI' =>
[
'name' => "Liechtenstein",
'ISO3' => "LIE",
'capital' => "Vaduz",
'phone' => "423",
'currency' => "CHF",
],
'LV' =>
[
'name' => "Latvia",
'ISO3' => "LVA",
'capital' => "Riga",
'phone' => "371",
'currency' => "EUR",
],
'TO' =>
[
'name' => "Tonga",
'ISO3' => "TON",
'capital' => "Nuku'alofa",
'phone' => "676",
'currency' => "TOP",
],
'LT' =>
[
'name' => "Lithuania",
'ISO3' => "LTU",
'capital' => "Vilnius",
'phone' => "370",
'currency' => "LTL",
],
'LU' =>
[
'name' => "Luxembourg",
'ISO3' => "LUX",
'capital' => "Luxembourg",
'phone' => "352",
'currency' => "EUR",
],
'LR' =>
[
'name' => "Liberia",
'ISO3' => "LBR",
'capital' => "Monrovia",
'phone' => "231",
'currency' => "LRD",
],
'LS' =>
[
'name' => "Lesotho",
'ISO3' => "LSO",
'capital' => "Maseru",
'phone' => "266",
'currency' => "LSL",
],
'TH' =>
[
'name' => "Thailand",
'ISO3' => "THA",
'capital' => "Bangkok",
'phone' => "66",
'currency' => "THB",
],
'TF' =>
[
'name' => "French Southern Territories",
'ISO3' => "ATF",
'capital' => "Port-aux-Francais",
'phone' => "",
'currency' => "EUR",
],
'TG' =>
[
'name' => "Togo",
'ISO3' => "TGO",
'capital' => "Lome",
'phone' => "228",
'currency' => "XOF",
],
'TD' =>
[
'name' => "Chad",
'ISO3' => "TCD",
'capital' => "N'Djamena",
'phone' => "235",
'currency' => "XAF",
],
'TC' =>
[
'name' => "Turks and Caicos Islands",
'ISO3' => "TCA",
'capital' => "Cockburn Town",
'phone' => "+1-649",
'currency' => "USD",
],
'LY' =>
[
'name' => "Libya",
'ISO3' => "LBY",
'capital' => "Tripolis",
'phone' => "218",
'currency' => "LYD",
],
'VA' =>
[
'name' => "Vatican",
'ISO3' => "VAT",
'capital' => "Vatican City",
'phone' => "379",
'currency' => "EUR",
],
'VC' =>
[
'name' => "Saint Vincent and the Grenadines",
'ISO3' => "VCT",
'capital' => "Kingstown",
'phone' => "+1-784",
'currency' => "XCD",
],
'AE' =>
[
'name' => "United Arab Emirates",
'ISO3' => "ARE",
'capital' => "Abu Dhabi",
'phone' => "971",
'currency' => "AED",
],
'AD' =>
[
'name' => "Andorra",
'ISO3' => "AND",
'capital' => "Andorra la Vella",
'phone' => "376",
'currency' => "EUR",
],
'AG' =>
[
'name' => "Antigua and Barbuda",
'ISO3' => "ATG",
'capital' => "St. John's",
'phone' => "+1-268",
'currency' => "XCD",
],
'AF' =>
[
'name' => "Afghanistan",
'ISO3' => "AFG",
'capital' => "Kabul",
'phone' => "93",
'currency' => "AFN",
],
'AI' =>
[
'name' => "Anguilla",
'ISO3' => "AIA",
'capital' => "The Valley",
'phone' => "+1-264",
'currency' => "XCD",
],
'VI' =>
[
'name' => "U.S. Virgin Islands",
'ISO3' => "VIR",
'capital' => "Charlotte Amalie",
'phone' => "+1-340",
'currency' => "USD",
],
'IS' =>
[
'name' => "Iceland",
'ISO3' => "ISL",
'capital' => "Reykjavik",
'phone' => "354",
'currency' => "ISK",
],
'IR' =>
[
'name' => "Iran",
'ISO3' => "IRN",
'capital' => "Tehran",
'phone' => "98",
'currency' => "IRR",
],
'AM' =>
[
'name' => "Armenia",
'ISO3' => "ARM",
'capital' => "Yerevan",
'phone' => "374",
'currency' => "AMD",
],
'AL' =>
[
'name' => "Albania",
'ISO3' => "ALB",
'capital' => "Tirana",
'phone' => "355",
'currency' => "ALL",
],
'AO' =>
[
'name' => "Angola",
'ISO3' => "AGO",
'capital' => "Luanda",
'phone' => "244",
'currency' => "AOA",
],
'AQ' =>
[
'name' => "Antarctica",
'ISO3' => "ATA",
'capital' => "",
'phone' => "",
'currency' => "",
],
'AS' =>
[
'name' => "American Samoa",
'ISO3' => "ASM",
'capital' => "Pago Pago",
'phone' => "+1-684",
'currency' => "USD",
],
'AR' =>
[
'name' => "Argentina",
'ISO3' => "ARG",
'capital' => "Buenos Aires",
'phone' => "54",
'currency' => "ARS",
],
'AU' =>
[
'name' => "Australia",
'ISO3' => "AUS",
'capital' => "Canberra",
'phone' => "61",
'currency' => "AUD",
],
'AT' =>
[
'name' => "Austria",
'ISO3' => "AUT",
'capital' => "Vienna",
'phone' => "43",
'currency' => "EUR",
],
'AW' =>
[
'name' => "Aruba",
'ISO3' => "ABW",
'capital' => "Oranjestad",
'phone' => "297",
'currency' => "AWG",
],
'IN' =>
[
'name' => "India",
'ISO3' => "IND",
'capital' => "New Delhi",
'phone' => "91",
'currency' => "INR",
],
'AX' =>
[
'name' => "Aland Islands",
'ISO3' => "ALA",
'capital' => "Mariehamn",
'phone' => "+358-18",
'currency' => "EUR",
],
'AZ' =>
[
'name' => "Azerbaijan",
'ISO3' => "AZE",
'capital' => "Baku",
'phone' => "994",
'currency' => "AZN",
],
'IE' =>
[
'name' => "Ireland",
'ISO3' => "IRL",
'capital' => "Dublin",
'phone' => "353",
'currency' => "EUR",
],
'ID' =>
[
'name' => "Indonesia",
'ISO3' => "IDN",
'capital' => "Jakarta",
'phone' => "62",
'currency' => "IDR",
],
'UA' =>
[
'name' => "Ukraine",
'ISO3' => "UKR",
'capital' => "Kiev",
'phone' => "380",
'currency' => "UAH",
],
'QA' =>
[
'name' => "Qatar",
'ISO3' => "QAT",
'capital' => "Doha",
'phone' => "974",
'currency' => "QAR",
],
'MZ' =>
[
'name' => "Mozambique",
'ISO3' => "MOZ",
'capital' => "Maputo",
'phone' => "258",
'currency' => "MZN",
],
];
/**
* Returns the country name list array with
* any valid field as the key
*
* @param string $value The field you want as the value for return array
* @param string $key The field you want as the key for return array
*
* @return array $countryList Array containing the list of countries
* @throws \Exception if the key or value field are not valid
*/
public static function getAllCountryList($value = 'name', $key = 'ISO2')
{
if ( ! in_array($value, ['ISO3', 'name', 'capital', 'currency', 'phone']))
{
throw new \Exception('Value is not a valid field name');
}
if ( ! in_array($key, ['ISO2', 'ISO3', 'name', 'capital', 'currency', 'phone']))
{
throw new \Exception('Key is not a valid field name');
}
$countryList = [];
foreach (self::$countries as $iso2 => $country)
{
if ($key == 'ISO2')
{
$countryList[$iso2] = $country[$value];
} else
{
$countryList[$country[$key]] = $country[$value];
}
}
return $countryList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment