Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP array of all country names
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe");
?>
@someguy9

This comment has been minimized.

someguy9 commented May 27, 2013

Just what I needed, thanks!

@uloga

This comment has been minimized.

uloga commented Jun 8, 2013

Thank you very much! :)

@teknotica

This comment has been minimized.

teknotica commented Aug 7, 2013

Thanks for this!

@faragelfadaly

This comment has been minimized.

faragelfadaly commented Sep 19, 2013

Thaaaaaanks

@Ronnieinspain

This comment has been minimized.

Ronnieinspain commented Sep 27, 2013

Many thanks, saved me hours of typing but please, take Yugoslavia out, they ceased to exist quite a while ago; Taiwan's status is also debatable, but i suggest leaving that one in or risk some angry taiwanese :)

@aliemre

This comment has been minimized.

aliemre commented Nov 9, 2013

Adamsın kardeşim!

@pkakelas

This comment has been minimized.

pkakelas commented Nov 25, 2013

I love you

@sixpetrov

This comment has been minimized.

sixpetrov commented Nov 25, 2013

Thank you so much.

@pascalbajorat

This comment has been minimized.

pascalbajorat commented Dec 14, 2013

Great, thank you.

@evandenberg

This comment has been minimized.

evandenberg commented Dec 19, 2013

Life saver! Thanks

@majidmushtaq91

This comment has been minimized.

majidmushtaq91 commented Feb 8, 2014

Very very useful thanks alot..

@jonbest

This comment has been minimized.

jonbest commented Feb 12, 2014

perfect!

@michaelcurry

This comment has been minimized.

michaelcurry commented Feb 19, 2014

Something no one wanted to do! thanks ! :)

@instantcarma

This comment has been minimized.

instantcarma commented Apr 9, 2014

// updated array

$country_array = array("Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Barbuda", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Trty.", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Caicos Islands", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Futuna Islands", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard", "Herzegovina", "Holy See", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Jan Mayen Islands", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea", "Korea (Democratic)", "Kuwait", "Kyrgyzstan", "Lao", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "McDonald Islands", "Mexico", "Micronesia", "Miquelon", "Moldova", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "Nevis", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestinian Territory, Occupied", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Principe", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Barthelemy", "Saint Helena", "Saint Kitts", "Saint Lucia", "Saint Martin (French part)", "Saint Pierre", "Saint Vincent", "Samoa", "San Marino", "Sao Tome", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia", "South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Grenadines", "Timor-Leste", "Tobago", "Togo", "Tokelau", "Tonga", "Trinidad", "Tunisia", "Turkey", "Turkmenistan", "Turks Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "US Minor Outlying Islands", "Uzbekistan", "Vanuatu", "Vatican City State", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (US)", "Wallis", "Western Sahara", "Yemen", "Zambia", "Zimbabwe");

@musen

This comment has been minimized.

musen commented Apr 10, 2014

than you

@Neungzad

This comment has been minimized.

Neungzad commented Apr 13, 2014

Thank you for country list, very useful :)

@Ciaro

This comment has been minimized.

Ciaro commented Apr 18, 2014

There is no need for double quotes.

@ralmarri12

This comment has been minimized.

ralmarri12 commented Apr 26, 2014

Thank you it was really helpful,

@Paul-Hume

This comment has been minimized.

Paul-Hume commented May 7, 2014

Just what I was looking for, thanks.

@RaymondBenc

This comment has been minimized.

RaymondBenc commented May 17, 2014

Thank you!

@kingthemes

This comment has been minimized.

kingthemes commented Jun 11, 2014

Thank you! in case you want a list with country codes:

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

@bmamouri

This comment has been minimized.

bmamouri commented Jun 15, 2014

Here is an associated array that contain countries name including the name of the country in their national language. I extracted the list from Google account setting page.

"Afghanistan (‫افغانستان‬‎)", "AX" => "Åland Islands (Åland)", "AL" => "Albania (Shqipëri)", "DZ" => "Algeria (‫الجزائر‬‎)", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia (Հայաստան)", "AW" => "Aruba", "AC" => "Ascension Island", "AU" => "Australia", "AT" => "Austria (Österreich)", "AZ" => "Azerbaijan (Azərbaycan)", "BS" => "Bahamas", "BH" => "Bahrain (‫البحرين‬‎)", "BD" => "Bangladesh (বাংলাদেশ)", "BB" => "Barbados", "BY" => "Belarus (Беларусь)", "BE" => "Belgium (België)", "BZ" => "Belize", "BJ" => "Benin (Bénin)", "BM" => "Bermuda", "BT" => "Bhutan (འབྲུག)", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina (Босна и Херцеговина)", "BW" => "Botswana", "BV" => "Bouvet Island", "BR" => "Brazil (Brasil)", "IO" => "British Indian Ocean Territory", "VG" => "British Virgin Islands", "BN" => "Brunei", "BG" => "Bulgaria (България)", "BF" => "Burkina Faso", "BI" => "Burundi (Uburundi)", "KH" => "Cambodia (កម្ពុជា)", "CM" => "Cameroon (Cameroun)", "CA" => "Canada", "IC" => "Canary Islands (islas Canarias)", "CV" => "Cape Verde (Kabu Verdi)", "BQ" => "Caribbean Netherlands", "KY" => "Cayman Islands", "CF" => "Central African Republic (République centrafricaine)", "EA" => "Ceuta and Melilla (Ceuta y Melilla)", "TD" => "Chad (Tchad)", "CL" => "Chile", "CN" => "China (中国)", "CX" => "Christmas Island", "CP" => "Clipperton Island", "CC" => "Cocos (Keeling) Islands (Kepulauan Cocos (Keeling))", "CO" => "Colombia", "KM" => "Comoros (‫جزر القمر‬‎)", "CD" => "Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "CG" => "Congo (Republic) (Congo-Brazzaville)", "CK" => "Cook Islands", "CR" => "Costa Rica", "CI" => "Côte d’Ivoire", "HR" => "Croatia (Hrvatska)", "CU" => "Cuba", "CW" => "Curaçao", "CY" => "Cyprus (Κύπρος)", "CZ" => "Czech Republic (Česká republika)", "DK" => "Denmark (Danmark)", "DG" => "Diego Garcia", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic (República Dominicana)", "EC" => "Ecuador", "EG" => "Egypt (‫مصر‬‎)", "SV" => "El Salvador", "GQ" => "Equatorial Guinea (Guinea Ecuatorial)", "ER" => "Eritrea", "EE" => "Estonia (Eesti)", "ET" => "Ethiopia", "FK" => "Falkland Islands (Islas Malvinas)", "FO" => "Faroe Islands (Føroyar)", "FJ" => "Fiji", "FI" => "Finland (Suomi)", "FR" => "France", "GF" => "French Guiana (Guyane française)", "PF" => "French Polynesia (Polynésie française)", "TF" => "French Southern Territories (Terres australes françaises)", "GA" => "Gabon", "GM" => "Gambia", "GE" => "Georgia (საქართველო)", "DE" => "Germany (Deutschland)", "GH" => "Ghana (Gaana)", "GI" => "Gibraltar", "GR" => "Greece (Ελλάδα)", "GL" => "Greenland (Kalaallit Nunaat)", "GD" => "Grenada", "GP" => "Guadeloupe", "GU" => "Guam", "GT" => "Guatemala", "GG" => "Guernsey", "GN" => "Guinea (Guinée)", "GW" => "Guinea-Bissau (Guiné Bissau)", "GY" => "Guyana", "HT" => "Haiti", "HM" => "Heard & McDonald Islands", "HN" => "Honduras", "HK" => "Hong Kong (香港)", "HU" => "Hungary (Magyarország)", "IS" => "Iceland (Ísland)", "IN" => "India (भारत)", "ID" => "Indonesia", "IR" => "Iran (‫ایران‬‎)", "IQ" => "Iraq (‫العراق‬‎)", "IE" => "Ireland", "IM" => "Isle of Man", "IL" => "Israel (‫ישראל‬‎)", "IT" => "Italy (Italia)", "JM" => "Jamaica", "JP" => "Japan (日本)", "JE" => "Jersey", "JO" => "Jordan (‫الأردن‬‎)", "KZ" => "Kazakhstan (Казахстан)", "KE" => "Kenya", "KI" => "Kiribati", "XK" => "Kosovo (Kosovë)", "KW" => "Kuwait (‫الكويت‬‎)", "KG" => "Kyrgyzstan (Кыргызстан)", "LA" => "Laos (ລາວ)", "LV" => "Latvia (Latvija)", "LB" => "Lebanon (‫لبنان‬‎)", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya (‫ليبيا‬‎)", "LI" => "Liechtenstein", "LT" => "Lithuania (Lietuva)", "LU" => "Luxembourg", "MO" => "Macau (澳門)", "MK" => "Macedonia (FYROM) (Македонија)", "MG" => "Madagascar (Madagasikara)", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MQ" => "Martinique", "MR" => "Mauritania (‫موريتانيا‬‎)", "MU" => "Mauritius (Moris)", "YT" => "Mayotte", "MX" => "Mexico (México)", "FM" => "Micronesia", "MD" => "Moldova (Republica Moldova)", "MC" => "Monaco", "MN" => "Mongolia (Монгол)", "ME" => "Montenegro (Crna Gora)", "MS" => "Montserrat", "MA" => "Morocco (‫المغرب‬‎)", "MZ" => "Mozambique (Moçambique)", "MM" => "Myanmar (Burma) (မြန်မာ)", "NA" => "Namibia (Namibië)", "NR" => "Nauru", "NP" => "Nepal (नेपाल)", "NL" => "Netherlands (Nederland)", "NC" => "New Caledonia (Nouvelle-Calédonie)", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger (Nijar)", "NG" => "Nigeria", "NU" => "Niue", "NF" => "Norfolk Island", "MP" => "Northern Mariana Islands", "KP" => "North Korea (조선 민주주의 인민 공화국)", "NO" => "Norway (Norge)", "OM" => "Oman (‫عُمان‬‎)", "PK" => "Pakistan (‫پاکستان‬‎)", "PW" => "Palau", "PS" => "Palestine (‫فلسطين‬‎)", "PA" => "Panama (Panamá)", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru (Perú)", "PH" => "Philippines", "PN" => "Pitcairn Islands", "PL" => "Poland (Polska)", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar (‫قطر‬‎)", "RE" => "Réunion (La Réunion)", "RO" => "Romania (România)", "RU" => "Russia (Россия)", "RW" => "Rwanda", "BL" => "Saint Barthélemy (Saint-Barthélemy)", "SH" => "Saint Helena", "KN" => "Saint Kitts and Nevis", "LC" => "Saint Lucia", "MF" => "Saint Martin (Saint-Martin (partie française))", "PM" => "Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "WS" => "Samoa", "SM" => "San Marino", "ST" => "São Tomé and Príncipe (São Tomé e Príncipe)", "SA" => "Saudi Arabia (‫المملكة العربية السعودية‬‎)", "SN" => "Senegal (Sénégal)", "RS" => "Serbia (Србија)", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SX" => "Sint Maarten", "SK" => "Slovakia (Slovensko)", "SI" => "Slovenia (Slovenija)", "SB" => "Solomon Islands", "SO" => "Somalia (Soomaaliya)", "ZA" => "South Africa", "GS" => "South Georgia & South Sandwich Islands", "KR" => "South Korea (대한민국)", "SS" => "South Sudan (‫جنوب السودان‬‎)", "ES" => "Spain (España)", "LK" => "Sri Lanka (ශ්‍රී ලංකාව)", "VC" => "St. Vincent & Grenadines", "SD" => "Sudan (‫السودان‬‎)", "SR" => "Suriname", "SJ" => "Svalbard and Jan Mayen (Svalbard og Jan Mayen)", "SZ" => "Swaziland", "SE" => "Sweden (Sverige)", "CH" => "Switzerland (Schweiz)", "SY" => "Syria (‫سوريا‬‎)", "TW" => "Taiwan (台灣)", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand (ไทย)", "TL" => "Timor-Leste", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TA" => "Tristan da Cunha", "TN" => "Tunisia (‫تونس‬‎)", "TR" => "Turkey (Türkiye)", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UM" => "U.S. Outlying Islands", "VI" => "U.S. Virgin Islands", "UG" => "Uganda", "UA" => "Ukraine (Україна)", "AE" => "United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "GB" => "United Kingdom", "US" => "United States", "UY" => "Uruguay", "UZ" => "Uzbekistan (Oʻzbekiston)", "VU" => "Vanuatu", "VA" => "Vatican City (Città del Vaticano)", "VE" => "Venezuela", "VN" => "Vietnam (Việt Nam)", "WF" => "Wallis and Futuna", "EH" => "Western Sahara (‫الصحراء الغربية‬‎)", "YE" => "Yemen (‫اليمن‬‎)", "ZM" => "Zambia", "ZW" => "Zimbabwe ); ?>
@relipse

This comment has been minimized.

relipse commented Jul 20, 2014

I needed a list with names compliant with the USPS Shipping Rate Calculator, so I gathered my own from http://pe.usps.gov/text/imm/immctry.htm as of 7/19/2014, I removed all the number references and commented out all the Domestic United States Terretories and Posessions so it would work with our shipping calculator. I tested about 20 of them just to ensure they were working and USPS accepted them! (Otherwise an error "Invalid Country Name" would occur) Note this list includes Localities (such as Ontario, Canada)

         $country_array = array(
            "Abu Dhabi (United Arab Emirates)",
            "Admiralty Islands (Papua New Guinea)",
            "Afghanistan",
            "Aitutaki, Cook Islands (New Zealand)",
            "Ajman (United Arab Emirates)",
            "Aland Island (Finland)",
            "Albania",
            "Alberta (Canada)",
            "Alderney (Channel Islands) (Great Britain and Northern Ireland)",
            "Algeria",
            "Alhucemas (Spain)",
            "Alofi Island (New Caledonia)",
            //"American Samoa",
            "Andaman Islands (India)",
            "Andorra",
            "Angola",
            "Anguilla",
            "Anjouan (Comoros)",
            "Annobon Island (Equatorial Guinea)",
            "Antigua (Antigua and Barbuda)",
            "Antigua and Barbuda",
            "Argentina",
            "Armenia",
            "Aruba",
            "Ascension",
            "Astypalaia (Greece)",
            "Atafu (Western Samoa)",
            "Atiu, Cook Islands (New Zealand)",
            "Australia",
            "Austria",
            "Avarua (New Zealand)",
            "Azerbaijan",
            "Azores (Portugal)",
            "Bahamas",
            "Bahrain",
            "Balearic Islands (Spain)",
            "Balochistan (Pakistan)",
            "Bangladesh",
            "Banks Island (Vanuatu)",
            "Barbados",
            "Barbuda (Antigua and Barbuda)",
            "Barthelemy (Guadeloupe)",
            "Belarus",
            "Belgium",
            "Belize",
            "Benin",
            "Bermuda",
            "Bhutan",
            "Bismark Archipelago (Papua New Guinea)",
            "Bolivia",
            "Bonaire (Curacao)",
            "Borabora (French Polynesia)",
            "Borneo (Indonesia)",
            "Bosnia-Herzegovina",
            "Botswana",
            "Bougainville (Papua New Guinea)",
            "Bourbon (Reunion)",
            "Brazil",
            "British Columbia (Canada)",
            "British Guiana (Guyana)",
            "British Virgin Islands",
            "Brunei Darussalam",
            "Buka (Papua New Guinea)",
            "Bulgaria",
            "Burkina Faso",
            "Burma",
            "Burundi",
            "Caicos Islands (Turks and Caicos Islands)",
            "Cambodia",
            "Cameroon",
            "Canada",
            "Canary Islands (Spain)",
            "Canton Island (Kiribati)",
            "Cape Verde",
            "Cayman Islands",
            "Central African Republic",
            "Ceuta (Spain)",
            "Ceylon (Sri Lanka)",
            "Chad",
            "Chaferinas Islands (Spain)",
            "Chalki (Greece)",
            "Channel Islands (Jersey, Guernsey, Alderney, and Sark) (Great Britain and Northern Ireland)",
            "Chile",
            "China",
            //"Christiansted, US Virgin Islands, United States (Domestic Mail)",
            "Christmas Island (Australia)",
            "Christmas Island (Kiribati)",
            //"Chuuk, Micronesia, United States (Domestic Mail)",
            "Cocos Island (Australia)",
            "Colombia",
            "Comoros",
            "Congo, Democratic Republic of the",
            "Congo, Republic of the",
            "Cook Islands (New Zealand)",
            "Corisco Island (Equatorial Guinea)",
            "Corsica (France)",
            "Costa Rica",
            "Cote d’Ivoire",
            "Crete (Greece)",
            "Croatia",
            "Cuba",
            "Cumino Island (Malta)",
            "Curacao (includes Bonaire, Saba, and Sint Eustatius)",
            "Cyjrenaica (Libya)",
            "Cyprus",
            "Czech Republic",
            "Dahomey (Benin)",
            "Damao (India)",
            "Danger Islands (New Zealand)",
            "Denmark",
            "Desirade Island (Guadeloupe)",
            "Diu (India)",
            "Djibouti",
            "Dodecanese Islands (Greece)",
            "Doha (Qatar)",
            "Dominica",
            "Dominican Republic",
            "Dubai (United Arab Emirates)",
            "East Timor (Timor-Leste)",
            //"Ebeye, Marshall Islands, United States   (Domestic Mail)",
            "Ecuador",
            "Egypt",
            "Eire (Ireland)",
            "El Salvador",
            "Ellice Islands (Tuvalu)",
            "Elobey Islands (Equatorial Guinea)",
            "Enderbury Island (Kiribati)",
            "England (Great Britain and Northern Ireland)",
            "Equatorial Guinea",
            "Eritrea",
            "Estonia",
            "Ethiopia",
            "Fakaofo (Western Samoa)",
            "Falkland Islands",
            "Fanning Island (Kiribati)",
            "Faroe Islands",
            "Fernando Po (Equatorial Guinea)",
            "Fezzan (Libya)",
            "Fiji",
            "Finland",
            "Formosa (Taiwan)",
            "France",
            //"Frederiksted, US Virgin Islands, United States (Domestic Mail)",
            "French Guiana",
            "French Oceania (French Polynesia)",
            "French Polynesia",
            "French West Indies (Guadeloupe)",
            "French West Indies (Martinique)",
            "Friendly Islands (Tonga)",
            "Fujairah (United Arab Emirates)",
            "Futuna (Wallis and Futuna Islands)",
            "Gabon",
            "Gambia",
            "Gambier (French Polynesia)",
            "Georgia, Republic of",
            "Germany",
            "Ghana",
            "Gibraltar",
            "Gilbert Islands (Kiribati)",
            "Goa (India)",
            "Gozo Island (Malta)",
            "Grand Comoro (Comoros)",
            "Great Britain and Northern Ireland",
            "Greece",
            "Greenland",
            "Grenada",
            "Grenadines (Saint Vincent and the Grenadines)",
            "Guadeloupe",
            //"Guam, United States (Domestic Mail)",
            "Guatemala",
            "Guernsey (Channel Islands) (Great Britain and Northern Ireland)",
            "Guinea",
            "Guinea–Bissau",
            "Guyana",
            "Hainan Island (China)",
            "Haiti",
            "Hashemite Kingdom (Jordan)",
            "Hervey, Cook Islands (New Zealand)",
            "Hivaoa (French Polynesia)",
            "Holland (Netherlands)",
            "Honduras",
            "Hong Kong",
            "Huahine (French Polynesia)",
            "Huan Island (New Caledonia)",
            "Hungary",
            "Iceland",
            "India",
            "Indonesia",
            "Iran",
            "Iraq",
            "Ireland",
            "Irian Barat (Indonesia)",
            "Isle of Man (Great Britain and Northern Ireland)",
            "Isle of Pines (New Caledonia)",
            "Isle of Pines, West Indies (Cuba)",
            "Israel",
            "Issas (Djibouti)",
            "Italy",
            "Ivory Coast (Cote d’Ivoire)",
            "Jamaica",
            "Japan",
            "Jersey (Channel Islands) (Great Britain and Northern Ireland)",
            "Johore (Malaysia)",
            "Jordan",
            "Kalymnos (Greece)",
            "Kampuchea (Cambodia)",
            "Karpathos (Greece)",
            "Kassos (Greece)",
            "Kastellorizon (Greece)",
            "Kazakhstan",
            "Kedah (Malaysia)",
            "Keeling Islands (Australia)",
            "Kelantan (Malaysia)",
            "Kenya",
            //"Kingshill, US Virgin Islands, United States (Domestic Mail)",
            "Kiribati",
            "Korea, Democratic People’s Republic of
            (North Korea)",
            "Korea, Republic of (South Korea)",
            //"Koror (Palau), United States (Domestic Mail)",
            "Kos (Greece)",
            "Kosovo, Republic of",
            //"Kosrae, Micronesia, United States (Domestic Mail)",
            "Kowloon (Hong Kong)",
            "Kuwait",
            //"Kwajalein, Marshall Islands, United States (Domestic Mail)",
            "Kyrgyzstan",
            "Labrador (Canada)",
            "Labuan (Malaysia)",
            "Laos",
            "Latvia",
            "Lebanon",
            "Leipsos (Greece)",
            "Leros (Greece)",
            "Les Saints Island (Guadeloupe)",
            "Lesotho",
            "Liberia",
            "Libya",
            "Liechtenstein",
            "Lithuania",
            "Lord Howe Island (Australia)",
            "Loyalty Islands (New Caledonia)",
            "Luxembourg",
            "Macao",
            "Macau (Macao)",
            "Macedonia, Republic of",
            "Madagascar",
            "Madeira Islands (Portugal)",
            //"Majuro, Marshall Islands, United States (Domestic Mail)",
            "Malacca (Malaysia)",
            "Malawi",
            "Malaysia",
            "Maldives",
            "Mali",
            "Malta",
            "Manahiki (New Zealand)",
            "Manchuria (China)",
            "Manitoba (Canada)",
            //"Manua Islands, American Samoa, United States (Domestic Mail)",
            "Marie Galante (Guadeloupe)",
            "Marquesas Islands (French Polynesia)",
            //"Marshall Islands, Republic of the, United States (Domestic Mail)",
            "Martinique",
            "Mauritania",
            "Mauritius",
            "Mayotte (France)",
            "Melilla (Spain)",
            "Mexico",
            //"Micronesia, Federated States of, United States (Domestic Mail)",
            "Miquelon (Saint Pierre and Miquelon)",
            "Moheli (Comoros)",
            "Moldova",
            "Monaco (France)",
            "Mongolia",
            "Montenegro",
            "Montserrat",
            "Moorea (French Polynesia)",
            "Morocco",
            "Mozambique",
            "Muscat (Oman)",
            "Myanmar (Burma)",
            "Namibia",
            "Nansil Islands (Japan)",
            "Nauru",
            "Negri Sembilan (Malaysia)",
            "Nepal",
            "Netherlands",
            "Netherlands Antilles (Curacao)",
            "Netherlands Antilles (Sint Maarten)",
            "Nevis (Saint Christopher and Nevis)",
            "New Britain (Papua New Guinea)",
            "New Brunswick (Canada)",
            "New Caledonia",
            "New Hanover (Papua New Guinea)",
            "New Hebrides (Vanuatu)",
            "New Ireland (Papua New Guinea)",
            "New South Wales (Australia)",
            "New Zealand",
            "Newfoundland (Canada)",
            "Nicaragua",
            "Niger",
            "Nigeria",
            "Nissiros (Greece)",
            "Niue (New Zealand)",
            "Norfolk Island (Australia)",
            "North Borneo (Malaysia)",
            "North Korea (Korea, Democratic People’s
            Republic of)",
            "Northern Ireland
            (Great Britain and Northern Ireland)",
            //"Northern Mariana Islands, Commonwealth of, United States (Domestic Mail)",
            "Northwest Territory (Canada)",
            "Norway",
            "Nova Scotia (Canada)",
            "Nukahiva (French Polynesia)",
            "Nukunonu (Western Samoa)",
            "Ocean Island (Kiribati)",
            "Okinawa (Japan)",
            "Oman",
            "Ontario (Canada)",
            //"Pago Pago, American Samoa, United States (Domestic Mail)",
            "Pahang (Malaysia)",
            "Pakistan",
            //"Palau, United States (Domestic Mail)",
            "Palmerston, Avarua (New Zealand)",
            "Panama",
            "Papua New Guinea",
            "Paraguay",
            "Parry, Cook Islands (New Zealand)",
            "Patmos (Greece)",
            "Pemba (Tanzania)",
            "Penang (Malaysia)",
            "Penghu Islands (Taiwan)",
            "Penon de Velez de la Gomera (Spain)",
            "Penrhyn, Tongareva (New Zealand)",
            "Perak (Malaysia)",
            "Perlis (Malaysia)",
            "Persia (Iran)",
            "Peru",
            "Pescadores Islands (Taiwan)",
            "Petite Terre (Guadeloupe)",
            "Philippines",
            "Pitcairn Island",
            //"Pohnpei, Micronesia, United States (Domestic Mail)",
            "Poland",
            "Portugal",
            "Prince Edward Island (Canada)",
            //"Puerto Rico, United States (Domestic Mail)",
            "Pukapuka (New Zealand)",
            "Qatar",
            "Quebec (Canada)",
            "Queensland (Australia)",
            "Quemoy (Taiwan)",
            "Raiatea (French Polynesia)",
            "Rakaanga (New Zealand)",
            "Rapa (French Polynesia)",
            "Rarotonga, Cook Islands (New Zealand)",
            "Ras al Kaimah (United Arab Emirates)",
            "Redonda (Antigua and Barbuda)",
            "Reunion",
            "Rio Muni (Equatorial Guinea)",
            "Rodos (Greece)",
            "Rodrigues (Mauritius)",
            "Romania",
            //"Rota, Northern Mariana Islands, United States (Domestic Mail)",
            "Russia",
            "Rwanda",
            "Saba (Curacao)",
            "Sabah (Malaysia)",
            "Saint Barthelemy (Guadeloupe)",
            "Saint Bartholomew (Guadeloupe)",
            "Saint Christopher and Nevis",
            //"Saint Croix, US Virgin Islands, United States (Domestic Mail)",
            "Saint Helena",
            //"Saint John, US Virgin Islands, United States (Domestic Mail)",
            "Saint Kitts (Saint Christopher and Nevis)",
            "Saint Lucia",
            "Saint Martin (French) (Guadeloupe)",
            "Saint Pierre and Miquelon",
            //"Saint Thomas, US Virgin Islands, United States (Domestic Mail)",
            "Saint Vincent and the Grenadines",
            "Sainte Marie de Madagascar (Madagascar)",
            //"Saipan, Northern Mariana Islands, United States (Domestic Mail)",
            "Salvador (El Salvador)",
            //"Samoa, American, United States (Domestic Mail)",
            "San Marino",
            "Santa Cruz Islands (Solomon Islands)",
            "Sao Tome and Principe",
            "Sarawak (Malaysia)",
            "Sark (Channel Islands) (Great Britain and Northern Ireland)",
            "Saskatchewan (Canada)",
            "Saudi Arabia",
            "Savage Island, Niue (New Zealand)",
            "Savaii Island (Western Samoa)",
            "Scotland (Great Britain and Northern Ireland)",
            "Seberang Perai (Malaysia)",
            "Selangor (Malaysia)",
            "Senegal",
            "Serbia, Republic of",
            "Seychelles",
            "Sharja (United Arab Emirates)",
            "Shikoku (Japan)",
            "Sierra Leone",
            "Sikkim (India)",
            "Singapore",
            "Sint Eustatius (Curacao)",
            "Sint Maarten (Dutch)",
            "Slovak Republic (Slovakia)",
            "Slovenia",
            "Society Islands (French Polynesia)",
            "Solomon Islands",
            "Somali Democratic Republic (Somalia)",
            "Somalia",
            "Somaliland (Somalia)",
            "South Africa",
            "South Australia (Australia)",
            "South Georgia (Falkland Islands)",
            "South Korea (Korea, Republic of)",
            "Spain",
            "Spitzbergen (Norway)",
            "Sri Lanka",
            "Sudan",
            "Suriname",
            "Suwarrow Islands (New Zealand)",
            //"Swain’s Island, American Samoa, United States (Domestic Mail)",
            "Swan Islands (Honduras)",
            "Swaziland",
            "Sweden",
            "Switzerland",
            "Symi (Greece)",
            "Syrian Arab Republic (Syria)",
            "Tahaa (French Polynesia)",
            "Tahiti (French Polynesia)",
            "Taiwan",
            "Tajikistan",
            "Tanzania",
            "Tasmania (Australia)",
            "Tchad (Chad)",
            "Thailand",
            "Thursday Island (Australia)",
            "Tibet (China)",
            "Tilos (Greece)",
            "Timor (Indonesia)",
            "Timor-Leste, Democratic Republic of",
            //"Tinian, Northern Mariana Islands, United States (Domestic Mail)",
            "Tobago (Trinidad and Tobago)",
            "Togo",
            "Tokelau (Western Samoa)",
            "Tonga",
            "Tongareva (New Zealand)",
            "Tori Shima (Japan)",
            "Torres Island (Vanuatu)",
            "Trans-Jordan, Hashemite Kingdom (Jordan)",
            "Transkei (South Africa)",
            "Trengganu (Malaysia)",
            "Trinidad and Tobago",
            "Tripolitania (Libya)",
            "Tristan da Cunha",
            "Trucial States (United Arab Emirates)",
            "Tuamotou (French Polynesia)",
            "Tubuai (French Polynesia)",
            "Tunisia",
            "Turkey",
            "Turkmenistan",
            "Turks and Caicos Islands",
            //"Tutuila Island, American Samoa, United States (Domestic Mail)",
            "Tuvalu",
            "Uganda",
            "Ukraine",
            "Umm al Quaiwain (United Arab Emirates)",
            "Umm Said (Qatar)",
            "United Arab Emirates",
            "United Kingdom (Great Britain and Northern Ireland)",
            //"United Nations, New York, United States (Domestic Mail)",
            "Upolu Island (Western Samoa)",
            "Uruguay",
            "Uzbekistan",
            "Vanuatu",
            "Vatican City",
            "Venezuela",
            "Victoria (Australia)",
            "Vietnam",
            "Virgin Islands (British)",
            //"Virgin Islands (US), United States (Domestic Mail)",
            "Wales (Great Britain and Northern Ireland)",
            "Wallis and Futuna Islands",
            "Wellesley, Province (Malaysia)",
            "West New Guinea (Indonesia)",
            "Western Australia (Australia)",
            "Western Samoa",
            //"Yap, Micronesia, United States   (Domestic Mail)",
            "Yemen",
            "Yukon Territory (Canada)",
            "Zafarani Islands (Spain)",
            "Zambia",
            "Zanzibar (Tanzania)",
            "Zimbabwe",
        );
@sysang

This comment has been minimized.

sysang commented Sep 3, 2014

really thanks

@tharindu-b

This comment has been minimized.

tharindu-b commented Jan 29, 2015

thanks a lot....

@MimiDub

This comment has been minimized.

MimiDub commented Jan 29, 2015

Thank you all !

@MartinWeise

This comment has been minimized.

MartinWeise commented Feb 7, 2015

Thank you a lot!

@dougcassidy

This comment has been minimized.

dougcassidy commented Apr 9, 2015

```

$countries = array(
"AF" => array('name'=>"Afghanistan", 'nativetongue'=>"‫افغانستان"),
"AX" => array('name'=>"Åland Islands", 'nativetongue'=>"Åland"),
"AL" => array('name'=>"Albania", 'nativetongue'=>"Shqipëri"),
"DZ" => array('name'=>"Algeria", 'nativetongue'=>"‫الجزائر"),
"AS" => array('name'=>"American Samoa", 'nativetongue'=>""),
"AD" => array('name'=>"Andorra", 'nativetongue'=>""),
"AO" => array('name'=>"Angola", 'nativetongue'=>""),
"AI" => array('name'=>"Anguilla", 'nativetongue'=>""),
"AQ" => array('name'=>"Antarctica", 'nativetongue'=>""),
"AG" => array('name'=>"Antigua and Barbuda", 'nativetongue'=>""),
"AR" => array('name'=>"Argentina", 'nativetongue'=>""),
"AM" => array('name'=>"Armenia", 'nativetongue'=>"Հայաստան"),
"AW" => array('name'=>"Aruba", 'nativetongue'=>""),
"AC" => array('name'=>"Ascension Island", 'nativetongue'=>""),
"AU" => array('name'=>"Australia", 'nativetongue'=>""),
"AT" => array('name'=>"Austria", 'nativetongue'=>"Österreich"),
"AZ" => array('name'=>"Azerbaijan", 'nativetongue'=>"Azərbaycan"),
"BS" => array('name'=>"Bahamas", 'nativetongue'=>""),
"BH" => array('name'=>"Bahrain", 'nativetongue'=>"‫البحرين"),
"BD" => array('name'=>"Bangladesh", 'nativetongue'=>"বাংলাদেশ"),
"BB" => array('name'=>"Barbados", 'nativetongue'=>""),
"BY" => array('name'=>"Belarus", 'nativetongue'=>"Беларусь"),
"BE" => array('name'=>"Belgium", 'nativetongue'=>"België"),
"BZ" => array('name'=>"Belize", 'nativetongue'=>""),
"BJ" => array('name'=>"Benin", 'nativetongue'=>"Bénin"),
"BM" => array('name'=>"Bermuda", 'nativetongue'=>""),
"BT" => array('name'=>"Bhutan", 'nativetongue'=>"འབྲུག"),
"BO" => array('name'=>"Bolivia", 'nativetongue'=>""),
"BA" => array('name'=>"Bosnia and Herzegovina", 'nativetongue'=>"Босна и Херцеговина"),
"BW" => array('name'=>"Botswana", 'nativetongue'=>""),
"BV" => array('name'=>"Bouvet Island", 'nativetongue'=>""),
"BR" => array('name'=>"Brazil", 'nativetongue'=>"Brasil"),
"IO" => array('name'=>"British Indian Ocean Territory",'nativetongue'=>""),
"VG" => array('name'=>"British Virgin Islands", 'nativetongue'=>""),
"BN" => array('name'=>"Brunei", 'nativetongue'=>""),
"BG" => array('name'=>"Bulgaria", 'nativetongue'=>"България"),
"BF" => array('name'=>"Burkina Faso", 'nativetongue'=>""),
"BI" => array('name'=>"Burundi", 'nativetongue'=>"Uburundi"),
"KH" => array('name'=>"Cambodia", 'nativetongue'=>"កម្ពុជា"),
"CM" => array('name'=>"Cameroon", 'nativetongue'=>"Cameroun"),
"CA" => array('name'=>"Canada", 'nativetongue'=>""),
"IC" => array('name'=>"Canary Islands", 'nativetongue'=>"islas Canarias"),
"CV" => array('name'=>"Cape Verde", 'nativetongue'=>"Kabu Verdi"),
"BQ" => array('name'=>"Caribbean Netherlands", 'nativetongue'=>""),
"KY" => array('name'=>"Cayman Islands", 'nativetongue'=>""),
"CF" => array('name'=>"Central African Republic",'nativetongue'=>"République centrafricaine"),
"EA" => array('name'=>"Ceuta and Melilla", 'nativetongue'=>"Ceuta y Melilla"),
"TD" => array('name'=>"Chad", 'nativetongue'=>"Tchad"),
"CL" => array('name'=>"Chile", 'nativetongue'=>""),
"CN" => array('name'=>"China", 'nativetongue'=>"中国"),
"CX" => array('name'=>"Christmas Island", 'nativetongue'=>""),
"CP" => array('name'=>"Clipperton Island", 'nativetongue'=>""),
"CC" => array('name'=>"Cocos (Keeling) Islands", 'nativetongue'=>"Kepulauan Cocos (Keeling)"),
"CO" => array('name'=>"Colombia", 'nativetongue'=>""),
"KM" => array('name'=>"Comoros", 'nativetongue'=>"‫جزر القمر"),
"CD" => array('name'=>"Congo (DRC)", 'nativetongue'=>"Jamhuri ya Kidemokrasia ya Kongo"),
"CG" => array('name'=>"Congo (Republic)", 'nativetongue'=>"Congo-Brazzaville"),
"CK" => array('name'=>"Cook Islands", 'nativetongue'=>""),
"CR" => array('name'=>"Costa Rica", 'nativetongue'=>""),
"CI" => array('name'=>"Côte d’Ivoire", 'nativetongue'=>""),
"HR" => array('name'=>"Croatia", 'nativetongue'=>"Hrvatska"),
"CU" => array('name'=>"Cuba", 'nativetongue'=>""),
"CW" => array('name'=>"Curaçao", 'nativetongue'=>""),
"CY" => array('name'=>"Cyprus", 'nativetongue'=>"Κύπρος"),
"CZ" => array('name'=>"Czech Republic", 'nativetongue'=>"Česká republika"),
"DK" => array('name'=>"Denmark", 'nativetongue'=>"Danmark"),
"DG" => array('name'=>"Diego Garcia", 'nativetongue'=>""),
"DJ" => array('name'=>"Djibouti", 'nativetongue'=>""),
"DM" => array('name'=>"Dominica", 'nativetongue'=>""),
"DO" => array('name'=>"Dominican Republic", 'nativetongue'=>"República Dominicana"),
"EC" => array('name'=>"Ecuador", 'nativetongue'=>""),
"EG" => array('name'=>"Egypt", 'nativetongue'=>"‫مصر"),
"SV" => array('name'=>"El Salvador", 'nativetongue'=>""),
"GQ" => array('name'=>"Equatorial Guinea",'nativetongue'=>"Guinea Ecuatorial"),
"ER" => array('name'=>"Eritrea", 'nativetongue'=>""),
"EE" => array('name'=>"Estonia", 'nativetongue'=>"Eesti"),
"ET" => array('name'=>"Ethiopia", 'nativetongue'=>""),
"FK" => array('name'=>"Falkland Islands", 'nativetongue'=>"Islas Malvinas"),
"FO" => array('name'=>"Faroe Islands", 'nativetongue'=>"Føroyar"),
"FJ" => array('name'=>"Fiji", 'nativetongue'=>""),
"FI" => array('name'=>"Finland", 'nativetongue'=>"Suomi"),
"FR" => array('name'=>"France", 'nativetongue'=>""),
"GF" => array('name'=>"French Guiana", 'nativetongue'=>"Guyane française"),
"PF" => array('name'=>"French Polynesia", 'nativetongue'=>"Polynésie française"),
"TF" => array('name'=>"French Southern Territories", 'nativetongue'=>"Terres australes françaises"),
"GA" => array('name'=>"Gabon", 'nativetongue'=>""),
"GM" => array('name'=>"Gambia", 'nativetongue'=>""),
"GE" => array('name'=>"Georgia", 'nativetongue'=>"საქართველო"),
"DE" => array('name'=>"Germany", 'nativetongue'=>"Deutschland"),
"GH" => array('name'=>"Ghana", 'nativetongue'=>"Gaana"),
"GI" => array('name'=>"Gibraltar", 'nativetongue'=>""),
"GR" => array('name'=>"Greece", 'nativetongue'=>"Ελλάδα"),
"GL" => array('name'=>"Greenland", 'nativetongue'=>"Kalaallit Nunaat"),
"GD" => array('name'=>"Grenada", 'nativetongue'=>""),
"GP" => array('name'=>"Guadeloupe", 'nativetongue'=>""),
"GU" => array('name'=>"Guam", 'nativetongue'=>""),
"GT" => array('name'=>"Guatemala", 'nativetongue'=>""),
"GG" => array('name'=>"Guernsey", 'nativetongue'=>""),
"GN" => array('name'=>"Guinea", 'nativetongue'=>"Guinée"),
"GW" => array('name'=>"Guinea-Bissau", 'nativetongue'=>"Guiné Bissau"),
"GY" => array('name'=>"Guyana", 'nativetongue'=>""),
"HT" => array('name'=>"Haiti", 'nativetongue'=>""),
"HM" => array('name'=>"Heard & McDonald Islands", 'nativetongue'=>""),
"HN" => array('name'=>"Honduras", 'nativetongue'=>""),
"HK" => array('name'=>"Hong Kong", 'nativetongue'=>"香港"),
"HU" => array('name'=>"Hungary", 'nativetongue'=>"Magyarország"),
"IS" => array('name'=>"Iceland", 'nativetongue'=>"Ísland"),
"IN" => array('name'=>"India", 'nativetongue'=>"भारत"),
"ID" => array('name'=>"Indonesia", 'nativetongue'=>""),
"IR" => array('name'=>"Iran", 'nativetongue'=>"‫ایران"),
"IQ" => array('name'=>"Iraq", 'nativetongue'=>"‫العراق"),
"IE" => array('name'=>"Ireland", 'nativetongue'=>""),
"IM" => array('name'=>"Isle of Man", 'nativetongue'=>""),
"IL" => array('name'=>"Israel", 'nativetongue'=>"‫ישראל"),
"IT" => array('name'=>"Italy", 'nativetongue'=>"Italia"),
"JM" => array('name'=>"Jamaica", 'nativetongue'=>""),
"JP" => array('name'=>"Japan", 'nativetongue'=>"日本"),
"JE" => array('name'=>"Jersey", 'nativetongue'=>""),
"JO" => array('name'=>"Jordan", 'nativetongue'=>"‫الأردن"),
"KZ" => array('name'=>"Kazakhstan", 'nativetongue'=>"Казахстан"),
"KE" => array('name'=>"Kenya", 'nativetongue'=>""),
"KI" => array('name'=>"Kiribati", 'nativetongue'=>""),
"XK" => array('name'=>"Kosovo", 'nativetongue'=>"Kosovë"),
"KW" => array('name'=>"Kuwait", 'nativetongue'=>"‫الكويت"),
"KG" => array('name'=>"Kyrgyzstan", 'nativetongue'=>"Кыргызстан"),
"LA" => array('name'=>"Laos", 'nativetongue'=>"ລາວ"),
"LV" => array('name'=>"Latvia", 'nativetongue'=>"Latvija"),
"LB" => array('name'=>"Lebanon", 'nativetongue'=>"‫لبنان"),
"LS" => array('name'=>"Lesotho", 'nativetongue'=>""),
"LR" => array('name'=>"Liberia", 'nativetongue'=>""),
"LY" => array('name'=>"Libya", 'nativetongue'=>"‫ليبيا"),
"LI" => array('name'=>"Liechtenstein", 'nativetongue'=>""),
"LT" => array('name'=>"Lithuania", 'nativetongue'=>"Lietuva"),
"LU" => array('name'=>"Luxembourg", 'nativetongue'=>""),
"MO" => array('name'=>"Macau", 'nativetongue'=>"澳門"),
"MK" => array('name'=>"Macedonia (FYROM)",'nativetongue'=>"Македонија"),
"MG" => array('name'=>"Madagascar", 'nativetongue'=>"Madagasikara"),
"MW" => array('name'=>"Malawi", 'nativetongue'=>""),
"MY" => array('name'=>"Malaysia", 'nativetongue'=>""),
"MV" => array('name'=>"Maldives", 'nativetongue'=>""),
"ML" => array('name'=>"Mali", 'nativetongue'=>""),
"MT" => array('name'=>"Malta", 'nativetongue'=>""),
"MH" => array('name'=>"Marshall Islands", 'nativetongue'=>""),
"MQ" => array('name'=>"Martinique", 'nativetongue'=>""),
"MR" => array('name'=>"Mauritania", 'nativetongue'=>"‫موريتانيا"),
"MU" => array('name'=>"Mauritius", 'nativetongue'=>"Moris"),
"YT" => array('name'=>"Mayotte", 'nativetongue'=>""),
"MX" => array('name'=>"Mexico", 'nativetongue'=>""),
"FM" => array('name'=>"Micronesia", 'nativetongue'=>""),
"MD" => array('name'=>"Moldova", 'nativetongue'=>"Republica Moldova"),
"MC" => array('name'=>"Monaco", 'nativetongue'=>""),
"MN" => array('name'=>"Mongolia", 'nativetongue'=>"Монгол"),
"ME" => array('name'=>"Montenegro", 'nativetongue'=>"Crna Gora"),
"MS" => array('name'=>"Montserrat", 'nativetongue'=>""),
"MA" => array('name'=>"Morocco", 'nativetongue'=>"‫المغرب"),
"MZ" => array('name'=>"Mozambique", 'nativetongue'=>"Moçambique"),
"MM" => array('name'=>"Myanmar (Burma)", 'nativetongue'=>"မြန်မာ"),
"NA" => array('name'=>"Namibia", 'nativetongue'=>"Namibië"),
"NR" => array('name'=>"Nauru", 'nativetongue'=>""),
"NP" => array('name'=>"Nepal", 'nativetongue'=>"नेपाल"),
"NL" => array('name'=>"Netherlands", 'nativetongue'=>"Nederland"),
"NC" => array('name'=>"New Caledonia", 'nativetongue'=>"Nouvelle-Calédonie"),
"NZ" => array('name'=>"New Zealand", 'nativetongue'=>""),
"NI" => array('name'=>"Nicaragua", 'nativetongue'=>""),
"NE" => array('name'=>"Niger", 'nativetongue'=>"Nijar"),
"NG" => array('name'=>"Nigeria", 'nativetongue'=>""),
"NU" => array('name'=>"Niue", 'nativetongue'=>""),
"NF" => array('name'=>"Norfolk Island", 'nativetongue'=>""),
"MP" => array('name'=>"Northern Mariana Islands", 'nativetongue'=>""),
"KP" => array('name'=>"North Korea", 'nativetongue'=>"조선 민주주의 인민 공화국"),
"NO" => array('name'=>"Norway", 'nativetongue'=>"Norge"),
"OM" => array('name'=>"Oman", 'nativetongue'=>"‫عُمان"),
"PK" => array('name'=>"Pakistan", 'nativetongue'=>"‫پاکستان"),
"PW" => array('name'=>"Palau", 'nativetongue'=>""),
"PS" => array('name'=>"Palestine", 'nativetongue'=>"‫فلسطين"),
"PA" => array('name'=>"Panama", 'nativetongue'=>""),
"PG" => array('name'=>"Papua New Guinea", 'nativetongue'=>""),
"PY" => array('name'=>"Paraguay", 'nativetongue'=>""),
"PE" => array('name'=>"Peru", 'nativetongue'=>"Perú"),
"PH" => array('name'=>"Philippines", 'nativetongue'=>""),
"PN" => array('name'=>"Pitcairn Islands", 'nativetongue'=>""),
"PL" => array('name'=>"Poland", 'nativetongue'=>"Polska"),
"PT" => array('name'=>"Portugal", 'nativetongue'=>""),
"PR" => array('name'=>"Puerto Rico", 'nativetongue'=>""),
"QA" => array('name'=>"Qatar", 'nativetongue'=>"‫قطر"),
"RE" => array('name'=>"Réunion", 'nativetongue'=>"La Réunion"),
"RO" => array('name'=>"Romania", 'nativetongue'=>"România"),
"RU" => array('name'=>"Russia", 'nativetongue'=>"Россия"),
"RW" => array('name'=>"Rwanda", 'nativetongue'=>""),
"BL" => array('name'=>"Saint Barthélemy", 'nativetongue'=>"Saint-Barthélemy"),
"SH" => array('name'=>"Saint Helena", 'nativetongue'=>""),
"KN" => array('name'=>"Saint Kitts and Nevis", 'nativetongue'=>""),
"LC" => array('name'=>"Saint Lucia", 'nativetongue'=>""),
"MF" => array('name'=>"Saint Martin", 'nativetongue'=>""),
"PM" => array('name'=>"Saint Pierre and Miquelon", 'nativetongue'=>"Saint-Pierre-et-Miquelon"),
"WS" => array('name'=>"Samoa", 'nativetongue'=>""),
"SM" => array('name'=>"San Marino", 'nativetongue'=>""),
"ST" => array('name'=>"São Tomé and Príncipe", 'nativetongue'=>"São Tomé e Príncipe"),
"SA" => array('name'=>"Saudi Arabia", 'nativetongue'=>"‫المملكة العربية السعودية"),
"SN" => array('name'=>"Senegal", 'nativetongue'=>"Sénégal"),
"RS" => array('name'=>"Serbia", 'nativetongue'=>"Србија"),
"SC" => array('name'=>"Seychelles", 'nativetongue'=>""),
"SL" => array('name'=>"Sierra Leone", 'nativetongue'=>""),
"SG" => array('name'=>"Singapore", 'nativetongue'=>""),
"SX" => array('name'=>"Sint Maarten", 'nativetongue'=>""),
"SK" => array('name'=>"Slovakia", 'nativetongue'=>"Slovensko"),
"SI" => array('name'=>"Slovenia", 'nativetongue'=>"Slovenija"),
"SB" => array('name'=>"Solomon Islands", 'nativetongue'=>""),
"SO" => array('name'=>"Somalia", 'nativetongue'=>"Soomaaliya"),
"ZA" => array('name'=>"South Africa", 'nativetongue'=>""),
"GS" => array('name'=>"South Georgia & South Sandwich Islands", 'nativetongue'=>""),
"KR" => array('name'=>"South Korea", 'nativetongue'=>"대한민국"),
"SS" => array('name'=>"South Sudan", 'nativetongue'=>"‫جنوب السودان"),
"ES" => array('name'=>"Spain", 'nativetongue'=>"España"),
"LK" => array('name'=>"Sri Lanka", 'nativetongue'=>"ශ්‍රී ලංකාව"),
"VC" => array('name'=>"St. Vincent & Grenadines", 'nativetongue'=>""),
"SD" => array('name'=>"Sudan", 'nativetongue'=>"‫السودان"),
"SR" => array('name'=>"Suriname", 'nativetongue'=>""),
"SJ" => array('name'=>"Svalbard and Jan Mayen", 'nativetongue'=>"Svalbard og Jan Mayen"),
"SZ" => array('name'=>"Swaziland", 'nativetongue'=>""),
"SE" => array('name'=>"Sweden", 'nativetongue'=>"Sverige"),
"CH" => array('name'=>"Switzerland", 'nativetongue'=>"Schweiz"),
"SY" => array('name'=>"Syria", 'nativetongue'=>"‫سوريا"),
"TW" => array('name'=>"Taiwan", 'nativetongue'=>"台灣"),
"TJ" => array('name'=>"Tajikistan", 'nativetongue'=>""),
"TZ" => array('name'=>"Tanzania", 'nativetongue'=>""),
"TH" => array('name'=>"Thailand", 'nativetongue'=>"ไทย"),
"TL" => array('name'=>"Timor-Leste", 'nativetongue'=>""),
"TG" => array('name'=>"Togo", 'nativetongue'=>""),
"TK" => array('name'=>"Tokelau", 'nativetongue'=>""),
"TO" => array('name'=>"Tonga", 'nativetongue'=>""),
"TT" => array('name'=>"Trinidad and Tobago", 'nativetongue'=>""),
"TA" => array('name'=>"Tristan da Cunha", 'nativetongue'=>""),
"TN" => array('name'=>"Tunisia", 'nativetongue'=>"‫تونس"),
"TR" => array('name'=>"Turkey", 'nativetongue'=>"Türkiye"),
"TM" => array('name'=>"Turkmenistan", 'nativetongue'=>""),
"TC" => array('name'=>"Turks and Caicos Islands", 'nativetongue'=>""),
"TV" => array('name'=>"Tuvalu", 'nativetongue'=>""),
"UM" => array('name'=>"U.S. Outlying Islands", 'nativetongue'=>""),
"VI" => array('name'=>"U.S. Virgin Islands", 'nativetongue'=>""),
"UG" => array('name'=>"Uganda", 'nativetongue'=>""),
"UA" => array('name'=>"Ukraine", 'nativetongue'=>"Україна"),
"AE" => array('name'=>"United Arab Emirates", 'nativetongue'=>"‫الإمارات العربية المتحدة"),
"GB" => array('name'=>"United Kingdom", 'nativetongue'=>""),
"US" => array('name'=>"United States", 'nativetongue'=>""),
"UY" => array('name'=>"Uruguay", 'nativetongue'=>""),
"UZ" => array('name'=>"Uzbekistan", 'nativetongue'=>"Oʻzbekiston"),
"VU" => array('name'=>"Vanuatu", 'nativetongue'=>""),
"VA" => array('name'=>"Vatican City", 'nativetongue'=>"Città del Vaticano"),
"VE" => array('name'=>"Venezuela", 'nativetongue'=>""),
"VN" => array('name'=>"Vietnam", 'nativetongue'=>"Việt Nam"),
"WF" => array('name'=>"Wallis and Futuna", 'nativetongue'=>""),
"EH" => array('name'=>"Western Sahara", 'nativetongue'=>"‫الصحراء الغربية"),
"YE" => array('name'=>"Yemen", 'nativetongue'=>"‫اليمن"),
"ZM" => array('name'=>"Zambia", 'nativetongue'=>""),
"ZW" => array('name'=>"Zimbabwe", 'nativetongue'=>"")

    ); 
@jhechavarria

This comment has been minimized.

jhechavarria commented Apr 20, 2015

Man, all this is awesome!

@miggymigz

This comment has been minimized.

miggymigz commented Apr 30, 2015

I love you guys

@sandes93

This comment has been minimized.

sandes93 commented Jun 16, 2015

Does anyone know where I can find a similar array for US states?

@vheidari

This comment has been minimized.

vheidari commented Jul 5, 2015

woow tanks guys 😊

@AshKab

This comment has been minimized.

AshKab commented Aug 9, 2015

Thanks! It saves lot of time.

@glengit

This comment has been minimized.

glengit commented Aug 31, 2015

thanks

@rajakhoury

This comment has been minimized.

rajakhoury commented Oct 20, 2015

Array of Countries Name + Code

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

United States - States + Code

 $US_states = [
                    ['code' => 'AL', 'name' => 'Alabama'],
                    ['code' => 'AK', 'name' => 'Alaska'],
                    ['code' => 'AS', 'name' => 'American Samoa'],
                    ['code' => 'AZ', 'name' => 'Arizona'],
                    ['code' => 'AR', 'name' => 'Arkansas'],
                    ['code' => 'CA', 'name' => 'California'],
                    ['code' => 'CO', 'name' => 'Colorado'],
                    ['code' => 'CT', 'name' => 'Connecticut'],
                    ['code' => 'DE', 'name' => 'Delaware'],
                    ['code' => 'DC', 'name' => 'Dist. of Columbia'],
                    ['code' => 'FL', 'name' => 'Florida'],
                    ['code' => 'GA', 'name' => 'Georgia'],
                    ['code' => 'GU', 'name' => 'Guam'],
                    ['code' => 'HI', 'name' => 'Hawaii'],
                    ['code' => 'ID', 'name' => 'Idaho'],
                    ['code' => 'IL', 'name' => 'Illinois'],
                    ['code' => 'IN', 'name' => 'Indiana'],
                    ['code' => 'IA', 'name' => 'Iowa'],
                    ['code' => 'KS', 'name' => 'Kansas'],
                    ['code' => 'KY', 'name' => 'Kentucky'],
                    ['code' => 'LA', 'name' => 'Louisiana'],
                    ['code' => 'ME', 'name' => 'Maine'],
                    ['code' => 'MD', 'name' => 'Maryland'],
                    ['code' => 'MH', 'name' => 'Marshall Islands'],
                    ['code' => 'MA', 'name' => 'Massachusetts'],
                    ['code' => 'MI', 'name' => 'Michigan'],
                    ['code' => 'FM', 'name' => 'Micronesia'],
                    ['code' => 'MN', 'name' => 'Minnesota'],
                    ['code' => 'MS', 'name' => 'Mississippi'],
                    ['code' => 'MO', 'name' => 'Missouri'],
                    ['code' => 'MT', 'name' => 'Montana'],
                    ['code' => 'NE', 'name' => 'Nebraska'],
                    ['code' => 'NV', 'name' => 'Nevada'],
                    ['code' => 'NH', 'name' => 'New Hampshire'],
                    ['code' => 'NJ', 'name' => 'New Jersey'],
                    ['code' => 'NM', 'name' => 'New Mexico'],
                    ['code' => 'NY', 'name' => 'New York'],
                    ['code' => 'NC', 'name' => 'North Carolina'],
                    ['code' => 'ND', 'name' => 'North Dakota'],
                    ['code' => 'MP', 'name' => 'Northern Marianas'],
                    ['code' => 'OH', 'name' => 'Ohio'],
                    ['code' => 'OK', 'name' => 'Oklahoma'],
                    ['code' => 'OR', 'name' => 'Oregon'],
                    ['code' => 'PW', 'name' => 'Palau'],
                    ['code' => 'PA', 'name' => 'Pennsylvania'],
                    ['code' => 'PR', 'name' => 'Puerto Rico'],
                    ['code' => 'RI', 'name' => 'Rhode Island'],
                    ['code' => 'SC', 'name' => 'South Carolina'],
                    ['code' => 'SD', 'name' => 'South Dakota'],
                    ['code' => 'TN', 'name' => 'Tennessee'],
                    ['code' => 'TX', 'name' => 'Texas'],
                    ['code' => 'UT', 'name' => 'Utah'],
                    ['code' => 'VT', 'name' => 'Vermont'],
                    ['code' => 'VA', 'name' => 'Virginia'],
                    ['code' => 'VI', 'name' => 'Virgin Islands'],
                    ['code' => 'WA', 'name' => 'Washington'],
                    ['code' => 'WV', 'name' => 'West Virginia'],
                    ['code' => 'WI', 'name' => 'Wisconsin'],
                    ['code' => 'WY', 'name' => 'Wyoming']
    ];

Canada - States + Code

    $CA_States = [
                    ['code' => 'AB', 'name' => 'Alberta'],
                    ['code' => 'BC', 'name' => 'British Columbia'],
                    ['code' => 'MB', 'name' => 'Manitoba'],
                    ['code' => 'NB', 'name' => 'New Brunswick'],
                    ['code' => 'NL', 'name' => 'Newfoundland and Labrador'],
                    ['code' => 'NT', 'name' => 'Northwest Territories'],
                    ['code' => 'NS', 'name' => 'Nova Scotia'],
                    ['code' => 'NU', 'name' => 'Nunavut'],
                    ['code' => 'ON', 'name' => 'Ontario'],
                    ['code' => 'PE', 'name' => 'Prince Edward Island'],
                    ['code' => 'QC', 'name' => 'Quebec'],
                    ['code' => 'SK', 'name' => 'Saskatchewan'],
                    ['code' => 'YT', 'name' => 'Yukon']
                ];

Australia - States + Code

    $AU_States = [
                    ['code' => 'NSW', 'name' => 'New South Wales'],
                    ['code' => 'QLD', 'name' => 'Queensland'],
                    ['code' => 'SA', 'name' => 'South Australia'],
                    ['code' => 'TAS', 'name' => 'Tasmania'],
                    ['code' => 'VIC', 'name' => 'Victoria'],
                    ['code' => 'WA', 'name' => 'Western Australia'],
                    ['code' => 'NT', 'name' => 'Northern Territory'],
                    ['code' => 'ACT', 'name' => 'Australian Capital Territory']
                ];
@webhacking

This comment has been minimized.

webhacking commented Oct 24, 2015

thank you for helpTT

@habeeb-salami

This comment has been minimized.

habeeb-salami commented Nov 12, 2015

Great Job Guys, You really save me some couple of minute of searching, compiling, and sorting

@0x1ad2

This comment has been minimized.

0x1ad2 commented Dec 3, 2015

@issahh89

This comment has been minimized.

issahh89 commented Jan 13, 2016

Thanks

@bridieamelia

This comment has been minimized.

bridieamelia commented Feb 24, 2016

Country array for form select dropdown (list taken from http://www.countries-list.info/Download-List)
array( " Afghanistan " => " Afghanistan " , " Albania " => " Albania " , " Algeria " => " Algeria " , " American Samoa " => " American Samoa " , " Andorra " => " Andorra " , " Angola " => " Angola " , " Anguilla " => " Anguilla " , " Antarctica " => " Antarctica " , " Antigua and Barbuda " => " Antigua and Barbuda " , " Argentina " => " Argentina " , " Armenia " => " Armenia " , " Aruba " => " Aruba " , " Australia " => " Australia " , " Austria " => " Austria " , " Azerbaijan " => " Azerbaijan " , " Bahamas " => " Bahamas " , " Bahrain " => " Bahrain " , " Bangladesh " => " Bangladesh " , " Barbados " => " Barbados " , " Belarus " => " Belarus " , " Belgium " => " Belgium " , " Belize " => " Belize " , " Benin " => " Benin " , " Bermuda " => " Bermuda " , " Bhutan " => " Bhutan " , " Bolivia " => " Bolivia " , " Bosnia and Herzegovina " => " Bosnia and Herzegovina " , " Botswana " => " Botswana " , " Bouvet Island " => " Bouvet Island " , " Brazil " => " Brazil " , " British Antarctic Territory " => " British Antarctic Territory " , " British Indian Ocean Territory " => " British Indian Ocean Territory " , " British Virgin Islands " => " British Virgin Islands " , " Brunei " => " Brunei " , " Bulgaria " => " Bulgaria " , " Burkina Faso " => " Burkina Faso " , " Burundi " => " Burundi " , " Cambodia " => " Cambodia " , " Cameroon " => " Cameroon " , " Canada " => " Canada " , " Canton and Enderbury Islands " => " Canton and Enderbury Islands " , " Cape Verde " => " Cape Verde " , " Cayman Islands " => " Cayman Islands " , " Central African Republic " => " Central African Republic " , " Chad " => " Chad " , " Chile " => " Chile " , " China " => " China " , " Christmas Island " => " Christmas Island " , " Cocos [Keeling] Islands " => " Cocos [Keeling] Islands " , " Colombia " => " Colombia " , " Comoros " => " Comoros " , " Congo - Brazzaville " => " Congo - Brazzaville " , " Congo - Kinshasa " => " Congo - Kinshasa " , " Cook Islands " => " Cook Islands " , " Costa Rica " => " Costa Rica " , " Croatia " => " Croatia " , " Cuba " => " Cuba " , " Cyprus " => " Cyprus " , " Czech Republic " => " Czech Republic " , " Côte d’Ivoire " => " Côte d’Ivoire " , " Denmark " => " Denmark " , " Djibouti " => " Djibouti " , " Dominica " => " Dominica " , " Dominican Republic " => " Dominican Republic " , " Dronning Maud Land " => " Dronning Maud Land " , " East Germany " => " East Germany " , " Ecuador " => " Ecuador " , " Egypt " => " Egypt " , " El Salvador " => " El Salvador " , " Equatorial Guinea " => " Equatorial Guinea " , " Eritrea " => " Eritrea " , " Estonia " => " Estonia " , " Ethiopia " => " Ethiopia " , " Falkland Islands " => " Falkland Islands " , " Faroe Islands " => " Faroe Islands " , " Fiji " => " Fiji " , " Finland " => " Finland " , " France " => " France " , " French Guiana " => " French Guiana " , " French Polynesia " => " French Polynesia " , " French Southern Territories " => " French Southern Territories " , " French Southern and Antarctic Territories " => " French Southern and Antarctic Territories " , " Gabon " => " Gabon " , " Gambia " => " Gambia " , " Georgia " => " Georgia " , " Germany " => " Germany " , " Ghana " => " Ghana " , " Gibraltar " => " Gibraltar " , " Greece " => " Greece " , " Greenland " => " Greenland " , " Grenada " => " Grenada " , " Guadeloupe " => " Guadeloupe " , " Guam " => " Guam " , " Guatemala " => " Guatemala " , " Guernsey " => " Guernsey " , " Guinea " => " Guinea " , " Guinea-Bissau " => " Guinea-Bissau " , " Guyana " => " Guyana " , " Haiti " => " Haiti " , " Heard Island and McDonald Islands " => " Heard Island and McDonald Islands " , " Honduras " => " Honduras " , " Hong Kong SAR China " => " Hong Kong SAR China " , " Hungary " => " Hungary " , " Iceland " => " Iceland " , " India " => " India " , " Indonesia " => " Indonesia " , " Iran " => " Iran " , " Iraq " => " Iraq " , " Ireland " => " Ireland " , " Isle of Man " => " Isle of Man " , " Israel " => " Israel " , " Italy " => " Italy " , " Jamaica " => " Jamaica " , " Japan " => " Japan " , " Jersey " => " Jersey " , " Johnston Island " => " Johnston Island " , " Jordan " => " Jordan " , " Kazakhstan " => " Kazakhstan " , " Kenya " => " Kenya " , " Kiribati " => " Kiribati " , " Kuwait " => " Kuwait " , " Kyrgyzstan " => " Kyrgyzstan " , " Laos " => " Laos " , " Latvia " => " Latvia " , " Lebanon " => " Lebanon " , " Lesotho " => " Lesotho " , " Liberia " => " Liberia " , " Libya " => " Libya " , " Liechtenstein " => " Liechtenstein " , " Lithuania " => " Lithuania " , " Luxembourg " => " Luxembourg " , " Macau SAR China " => " Macau SAR China " , " Macedonia " => " Macedonia " , " Madagascar " => " Madagascar " , " Malawi " => " Malawi " , " Malaysia " => " Malaysia " , " Maldives " => " Maldives " , " Mali " => " Mali " , " Malta " => " Malta " , " Marshall Islands " => " Marshall Islands " , " Martinique " => " Martinique " , " Mauritania " => " Mauritania " , " Mauritius " => " Mauritius " , " Mayotte " => " Mayotte " , " Metropolitan France " => " Metropolitan France " , " Mexico " => " Mexico " , " Micronesia " => " Micronesia " , " Midway Islands " => " Midway Islands " , " Moldova " => " Moldova " , " Monaco " => " Monaco " , " Mongolia " => " Mongolia " , " Montenegro " => " Montenegro " , " Montserrat " => " Montserrat " , " Morocco " => " Morocco " , " Mozambique " => " Mozambique " , " Myanmar [Burma] " => " Myanmar [Burma] " , " Namibia " => " Namibia " , " Nauru " => " Nauru " , " Nepal " => " Nepal " , " Netherlands " => " Netherlands " , " Netherlands Antilles " => " Netherlands Antilles " , " Neutral Zone " => " Neutral Zone " , " New Caledonia " => " New Caledonia " , " New Zealand " => " New Zealand " , " Nicaragua " => " Nicaragua " , " Niger " => " Niger " , " Nigeria " => " Nigeria " , " Niue " => " Niue " , " Norfolk Island " => " Norfolk Island " , " North Korea " => " North Korea " , " North Vietnam " => " North Vietnam " , " Northern Mariana Islands " => " Northern Mariana Islands " , " Norway " => " Norway " , " Oman " => " Oman " , " Pacific Islands Trust Territory " => " Pacific Islands Trust Territory " , " Pakistan " => " Pakistan " , " Palau " => " Palau " , " Palestinian Territories " => " Palestinian Territories " , " Panama " => " Panama " , " Panama Canal Zone " => " Panama Canal Zone " , " Papua New Guinea " => " Papua New Guinea " , " Paraguay " => " Paraguay " , " People's Democratic Republic of Yemen " => " People's Democratic Republic of Yemen " , " Peru " => " Peru " , " Philippines " => " Philippines " , " Pitcairn Islands " => " Pitcairn Islands " , " Poland " => " Poland " , " Portugal " => " Portugal " , " Puerto Rico " => " Puerto Rico " , " Qatar " => " Qatar " , " Romania " => " Romania " , " Russia " => " Russia " , " Rwanda " => " Rwanda " , " Réunion " => " Réunion " , " Saint Barthélemy " => " Saint Barthélemy " , " Saint Helena " => " Saint Helena " , " Saint Kitts and Nevis " => " Saint Kitts and Nevis " , " Saint Lucia " => " Saint Lucia " , " Saint Martin " => " Saint Martin " , " Saint Pierre and Miquelon " => " Saint Pierre and Miquelon " , " Saint Vincent and the Grenadines " => " Saint Vincent and the Grenadines " , " Samoa " => " Samoa " , " San Marino " => " San Marino " , " Saudi Arabia " => " Saudi Arabia " , " Senegal " => " Senegal " , " Serbia " => " Serbia " , " Serbia and Montenegro " => " Serbia and Montenegro " , " Seychelles " => " Seychelles " , " Sierra Leone " => " Sierra Leone " , " Singapore " => " Singapore " , " Slovakia " => " Slovakia " , " Slovenia " => " Slovenia " , " Solomon Islands " => " Solomon Islands " , " Somalia " => " Somalia " , " South Africa " => " South Africa " , " South Georgia and the South Sandwich Islands " => " South Georgia and the South Sandwich Islands " , " South Korea " => " South Korea " , " Spain " => " Spain " , " Sri Lanka " => " Sri Lanka " , " Sudan " => " Sudan " , " Suriname " => " Suriname " , " Svalbard and Jan Mayen " => " Svalbard and Jan Mayen " , " Swaziland " => " Swaziland " , " Sweden " => " Sweden " , " Switzerland " => " Switzerland " , " Syria " => " Syria " , " São Tomé and Príncipe " => " São Tomé and Príncipe " , " Taiwan " => " Taiwan " , " Tajikistan " => " Tajikistan " , " Tanzania " => " Tanzania " , " Thailand " => " Thailand " , " Timor-Leste " => " Timor-Leste " , " Togo " => " Togo " , " Tokelau " => " Tokelau " , " Tonga " => " Tonga " , " Trinidad and Tobago " => " Trinidad and Tobago " , " Tunisia " => " Tunisia " , " Turkey " => " Turkey " , " Turkmenistan " => " Turkmenistan " , " Turks and Caicos Islands " => " Turks and Caicos Islands " , " Tuvalu " => " Tuvalu " , " U.S. Minor Outlying Islands " => " U.S. Minor Outlying Islands " , " U.S. Miscellaneous Pacific Islands " => " U.S. Miscellaneous Pacific Islands " , " U.S. Virgin Islands " => " U.S. Virgin Islands " , " Uganda " => " Uganda " , " Ukraine " => " Ukraine " , " Union of Soviet Socialist Republics " => " Union of Soviet Socialist Republics " , " United Arab Emirates " => " United Arab Emirates " , " United Kingdom " => " United Kingdom " , " United States " => " United States " , " Unknown or Invalid Region " => " Unknown or Invalid Region " , " Uruguay " => " Uruguay " , " Uzbekistan " => " Uzbekistan " , " Vanuatu " => " Vanuatu " , " Vatican City " => " Vatican City " , " Venezuela " => " Venezuela " , " Vietnam " => " Vietnam " , " Wake Island " => " Wake Island " , " Wallis and Futuna " => " Wallis and Futuna " , " Western Sahara " => " Western Sahara " , " Yemen " => " Yemen " , " Zambia " => " Zambia " , " Zimbabwe " => " Zimbabwe " , " Åland Islands " => " Åland Islands " , )

@robertholf

This comment has been minimized.

robertholf commented Mar 21, 2016

Nice work @dougcassidy, I expanded it as a Laravel 5 seeder file:

    DB::table('data_location_country')->delete();
    $data = array(
        ['slug' => 'AF', 'title' => 'Afghanistan', 'native' => 'غانستان'],
        ['slug' => 'AX', 'title' => 'Åland Islands', 'native' => 'Åland'],
        ['slug' => 'AL', 'title' => 'Albania', 'native' => 'Shqipëri'],
        ['slug' => 'DZ', 'title' => 'Algeria', 'native' => 'الجزائر'],
        ['slug' => 'AS', 'title' => 'American Samoa', 'native' => ''],
        ['slug' => 'AD', 'title' => 'Andorra', 'native' => ''],
        ['slug' => 'AO', 'title' => 'Angola', 'native' => ''],
        ['slug' => 'AI', 'title' => 'Anguilla', 'native' => ''],
        ['slug' => 'AQ', 'title' => 'Antarctica', 'native' => ''],
        ['slug' => 'AG', 'title' => 'Antigua and Barbuda', 'native' => ''],
        ['slug' => 'AR', 'title' => 'Argentina', 'native' => ''],
        ['slug' => 'AM', 'title' => 'Armenia', 'native' => 'Հայաստան'],
        ['slug' => 'AW', 'title' => 'Aruba', 'native' => ''],
        ['slug' => 'AC', 'title' => 'Ascension Island', 'native' => ''],
        ['slug' => 'AU', 'title' => 'Australia', 'native' => ''],
        ['slug' => 'AT', 'title' => 'Austria', 'native' => 'Österreich'],
        ['slug' => 'AZ', 'title' => 'Azerbaijan', 'native' => 'Azərbaycan'],
        ['slug' => 'BS', 'title' => 'Bahamas', 'native' => ''],
        ['slug' => 'BH', 'title' => 'Bahrain', 'native' => 'البحرين'],
        ['slug' => 'BD', 'title' => 'Bangladesh', 'native' => 'বাংলাদেশ'],
        ['slug' => 'BB', 'title' => 'Barbados', 'native' => ''],
        ['slug' => 'BY', 'title' => 'Belarus', 'native' => 'Беларусь'],
        ['slug' => 'BE', 'title' => 'Belgium', 'native' => 'België'],
        ['slug' => 'BZ', 'title' => 'Belize', 'native' => ''],
        ['slug' => 'BJ', 'title' => 'Benin', 'native' => 'Bénin'],
        ['slug' => 'BM', 'title' => 'Bermuda', 'native' => ''],
        ['slug' => 'BT', 'title' => 'Bhutan', 'native' => 'འབྲུག'],
        ['slug' => 'BO', 'title' => 'Bolivia', 'native' => ''],
        ['slug' => 'BA', 'title' => 'Bosnia and Herzegovina', 'native' => 'Босна и Херцеговина'],
        ['slug' => 'BW', 'title' => 'Botswana', 'native' => ''],
        ['slug' => 'BV', 'title' => 'Bouvet Island', 'native' => ''],
        ['slug' => 'BR', 'title' => 'Brazil', 'native' => 'Brasil'],
        ['slug' => 'IO', 'title' => 'British Indian Ocean Territory', 'native' => ''],
        ['slug' => 'VG', 'title' => 'British Virgin Islands', 'native' => ''],
        ['slug' => 'BN', 'title' => 'Brunei', 'native' => ''],
        ['slug' => 'BG', 'title' => 'Bulgaria', 'native' => 'България'],
        ['slug' => 'BF', 'title' => 'Burkina Faso', 'native' => ''],
        ['slug' => 'BI', 'title' => 'Burundi', 'native' => 'Uburundi'],
        ['slug' => 'KH', 'title' => 'Cambodia', 'native' => 'កម្ពុជា'],
        ['slug' => 'CM', 'title' => 'Cameroon', 'native' => 'Cameroun'],
        ['slug' => 'CA', 'title' => 'Canada', 'native' => ''],
        ['slug' => 'IC', 'title' => 'Canary Islands', 'native' => 'islas Canarias'],
        ['slug' => 'CV', 'title' => 'Cape Verde', 'native' => 'Kabu Verdi'],
        ['slug' => 'BQ', 'title' => 'Caribbean Netherlands', 'native' => ''],
        ['slug' => 'KY', 'title' => 'Cayman Islands', 'native' => ''],
        ['slug' => 'CF', 'title' => 'Central African Republic', 'native' => 'République centrafricaine'],
        ['slug' => 'EA', 'title' => 'Ceuta and Melilla', 'native' => 'Ceuta y Melilla'],
        ['slug' => 'TD', 'title' => 'Chad', 'native' => 'Tchad'],
        ['slug' => 'CL', 'title' => 'Chile', 'native' => ''],
        ['slug' => 'CN', 'title' => 'China', 'native' => '中国'],
        ['slug' => 'CX', 'title' => 'Christmas Island', 'native' => ''],
        ['slug' => 'CP', 'title' => 'Clipperton Island', 'native' => ''],
        ['slug' => 'CC', 'title' => 'Cocos (Keeling) Islands', 'native' => 'Kepulauan Cocos (Keeling)'],
        ['slug' => 'CO', 'title' => 'Colombia', 'native' => ''],
        ['slug' => 'KM', 'title' => 'Comoros', 'native' => 'جزر القمر'],
        ['slug' => 'CD', 'title' => 'Congo (DRC)', 'native' => 'Jamhuri ya Kidemokrasia ya Kongo'],
        ['slug' => 'CG', 'title' => 'Congo (Republic)', 'native' => 'Congo-Brazzaville'],
        ['slug' => 'CK', 'title' => 'Cook Islands', 'native' => ''],
        ['slug' => 'CR', 'title' => 'Costa Rica', 'native' => ''],
        ['slug' => 'CI', 'title' => 'Côte d’Ivoire', 'native' => ''],
        ['slug' => 'HR', 'title' => 'Croatia', 'native' => 'Hrvatska'],
        ['slug' => 'CU', 'title' => 'Cuba', 'native' => ''],
        ['slug' => 'CW', 'title' => 'Curaçao', 'native' => ''],
        ['slug' => 'CY', 'title' => 'Cyprus', 'native' => 'Κύπρος'],
        ['slug' => 'CZ', 'title' => 'Czech Republic', 'native' => 'Česká republika'],
        ['slug' => 'DK', 'title' => 'Denmark', 'native' => 'Danmark'],
        ['slug' => 'DG', 'title' => 'Diego Garcia', 'native' => ''],
        ['slug' => 'DJ', 'title' => 'Djibouti', 'native' => ''],
        ['slug' => 'DM', 'title' => 'Dominica', 'native' => ''],
        ['slug' => 'DO', 'title' => 'Dominican Republic', 'native' => 'República Dominicana'],
        ['slug' => 'EC', 'title' => 'Ecuador', 'native' => ''],
        ['slug' => 'EG', 'title' => 'Egypt', 'native' => 'مصر'],
        ['slug' => 'SV', 'title' => 'El Salvador', 'native' => ''],
        ['slug' => 'GQ', 'title' => 'Equatorial Guinea', 'native' => 'Guinea Ecuatorial'],
        ['slug' => 'ER', 'title' => 'Eritrea', 'native' => ''],
        ['slug' => 'EE', 'title' => 'Estonia', 'native' => 'Eesti'],
        ['slug' => 'ET', 'title' => 'Ethiopia', 'native' => ''],
        ['slug' => 'FK', 'title' => 'Falkland Islands', 'native' => 'Islas Malvinas'],
        ['slug' => 'FO', 'title' => 'Faroe Islands', 'native' => 'Føroyar'],
        ['slug' => 'FJ', 'title' => 'Fiji', 'native' => ''],
        ['slug' => 'FI', 'title' => 'Finland', 'native' => 'Suomi'],
        ['slug' => 'FR', 'title' => 'France', 'native' => ''],
        ['slug' => 'GF', 'title' => 'French Guiana', 'native' => 'Guyane française'],
        ['slug' => 'PF', 'title' => 'French Polynesia', 'native' => 'Polynésie française'],
        ['slug' => 'TF', 'title' => 'French Southern Territories', 'native' => 'Terres australes françaises'],
        ['slug' => 'GA', 'title' => 'Gabon', 'native' => ''],
        ['slug' => 'GM', 'title' => 'Gambia', 'native' => ''],
        ['slug' => 'GE', 'title' => 'Georgia', 'native' => 'საქართველო'],
        ['slug' => 'DE', 'title' => 'Germany', 'native' => 'Deutschland'],
        ['slug' => 'GH', 'title' => 'Ghana', 'native' => 'Gaana'],
        ['slug' => 'GI', 'title' => 'Gibraltar', 'native' => ''],
        ['slug' => 'GR', 'title' => 'Greece', 'native' => 'Ελλάδα'],
        ['slug' => 'GL', 'title' => 'Greenland', 'native' => 'Kalaallit Nunaat'],
        ['slug' => 'GD', 'title' => 'Grenada', 'native' => ''],
        ['slug' => 'GP', 'title' => 'Guadeloupe', 'native' => ''],
        ['slug' => 'GU', 'title' => 'Guam', 'native' => ''],
        ['slug' => 'GT', 'title' => 'Guatemala', 'native' => ''],
        ['slug' => 'GG', 'title' => 'Guernsey', 'native' => ''],
        ['slug' => 'GN', 'title' => 'Guinea', 'native' => 'Guinée'],
        ['slug' => 'GW', 'title' => 'Guinea-Bissau', 'native' => 'Guiné Bissau'],
        ['slug' => 'GY', 'title' => 'Guyana', 'native' => ''],
        ['slug' => 'HT', 'title' => 'Haiti', 'native' => ''],
        ['slug' => 'HM', 'title' => 'Heard & McDonald Islands', 'native' => ''],
        ['slug' => 'HN', 'title' => 'Honduras', 'native' => ''],
        ['slug' => 'HK', 'title' => 'Hong Kong', 'native' => '香港'],
        ['slug' => 'HU', 'title' => 'Hungary', 'native' => 'Magyarország'],
        ['slug' => 'IS', 'title' => 'Iceland', 'native' => 'Ísland'],
        ['slug' => 'IN', 'title' => 'India', 'native' => 'भारत'],
        ['slug' => 'ID', 'title' => 'Indonesia', 'native' => ''],
        ['slug' => 'IR', 'title' => 'Iran', 'native' => 'ایران'],
        ['slug' => 'IQ', 'title' => 'Iraq', 'native' => 'العراق'],
        ['slug' => 'IE', 'title' => 'Ireland', 'native' => ''],
        ['slug' => 'IM', 'title' => 'Isle of Man', 'native' => ''],
        ['slug' => 'IL', 'title' => 'Israel', 'native' => 'ישראל'],
        ['slug' => 'IT', 'title' => 'Italy', 'native' => 'Italia'],
        ['slug' => 'JM', 'title' => 'Jamaica', 'native' => ''],
        ['slug' => 'JP', 'title' => 'Japan', 'native' => '日本'],
        ['slug' => 'JE', 'title' => 'Jersey', 'native' => ''],
        ['slug' => 'JO', 'title' => 'Jordan', 'native' => 'الأردن'],
        ['slug' => 'KZ', 'title' => 'Kazakhstan', 'native' => 'Казахстан'],
        ['slug' => 'KE', 'title' => 'Kenya', 'native' => ''],
        ['slug' => 'KI', 'title' => 'Kiribati', 'native' => ''],
        ['slug' => 'XK', 'title' => 'Kosovo', 'native' => 'Kosovë'],
        ['slug' => 'KW', 'title' => 'Kuwait', 'native' => 'الكويت'],
        ['slug' => 'KG', 'title' => 'Kyrgyzstan', 'native' => 'Кыргызстан'],
        ['slug' => 'LA', 'title' => 'Laos', 'native' => 'ລາວ'],
        ['slug' => 'LV', 'title' => 'Latvia', 'native' => 'Latvija'],
        ['slug' => 'LB', 'title' => 'Lebanon', 'native' => 'لبنان'],
        ['slug' => 'LS', 'title' => 'Lesotho', 'native' => ''],
        ['slug' => 'LR', 'title' => 'Liberia', 'native' => ''],
        ['slug' => 'LY', 'title' => 'Libya', 'native' => 'ليبيا'],
        ['slug' => 'LI', 'title' => 'Liechtenstein', 'native' => ''],
        ['slug' => 'LT', 'title' => 'Lithuania', 'native' => 'Lietuva'],
        ['slug' => 'LU', 'title' => 'Luxembourg', 'native' => ''],
        ['slug' => 'MO', 'title' => 'Macau', 'native' => '澳門'],
        ['slug' => 'MK', 'title' => 'Macedonia (FYROM)', 'native' => 'Македонија'],
        ['slug' => 'MG', 'title' => 'Madagascar', 'native' => 'Madagasikara'],
        ['slug' => 'MW', 'title' => 'Malawi', 'native' => ''],
        ['slug' => 'MY', 'title' => 'Malaysia', 'native' => ''],
        ['slug' => 'MV', 'title' => 'Maldives', 'native' => ''],
        ['slug' => 'ML', 'title' => 'Mali', 'native' => ''],
        ['slug' => 'MT', 'title' => 'Malta', 'native' => ''],
        ['slug' => 'MH', 'title' => 'Marshall Islands', 'native' => ''],
        ['slug' => 'MQ', 'title' => 'Martinique', 'native' => ''],
        ['slug' => 'MR', 'title' => 'Mauritania', 'native' => 'موريتانيا'],
        ['slug' => 'MU', 'title' => 'Mauritius', 'native' => 'Moris'],
        ['slug' => 'YT', 'title' => 'Mayotte', 'native' => ''],
        ['slug' => 'MX', 'title' => 'Mexico', 'native' => ''],
        ['slug' => 'FM', 'title' => 'Micronesia', 'native' => ''],
        ['slug' => 'MD', 'title' => 'Moldova', 'native' => 'Republica Moldova'],
        ['slug' => 'MC', 'title' => 'Monaco', 'native' => ''],
        ['slug' => 'MN', 'title' => 'Mongolia', 'native' => 'Монгол'],
        ['slug' => 'ME', 'title' => 'Montenegro', 'native' => 'Crna Gora'],
        ['slug' => 'MS', 'title' => 'Montserrat', 'native' => ''],
        ['slug' => 'MA', 'title' => 'Morocco', 'native' => 'المغرب'],
        ['slug' => 'MZ', 'title' => 'Mozambique', 'native' => 'Moçambique'],
        ['slug' => 'MM', 'title' => 'Myanmar (Burma)', 'native' => 'မြန်မာ'],
        ['slug' => 'NA', 'title' => 'Namibia', 'native' => 'Namibië'],
        ['slug' => 'NR', 'title' => 'Nauru', 'native' => ''],
        ['slug' => 'NP', 'title' => 'Nepal', 'native' => 'नेपाल'],
        ['slug' => 'NL', 'title' => 'Netherlands', 'native' => 'Nederland'],
        ['slug' => 'NC', 'title' => 'New Caledonia', 'native' => 'Nouvelle-Calédonie'],
        ['slug' => 'NZ', 'title' => 'New Zealand', 'native' => ''],
        ['slug' => 'NI', 'title' => 'Nicaragua', 'native' => ''],
        ['slug' => 'NE', 'title' => 'Niger', 'native' => 'Nijar'],
        ['slug' => 'NG', 'title' => 'Nigeria', 'native' => ''],
        ['slug' => 'NU', 'title' => 'Niue', 'native' => ''],
        ['slug' => 'NF', 'title' => 'Norfolk Island', 'native' => ''],
        ['slug' => 'MP', 'title' => 'Northern Mariana Islands', 'native' => ''],
        ['slug' => 'KP', 'title' => 'North Korea', 'native' => '조선 민주주의 인민 공화국'],
        ['slug' => 'NO', 'title' => 'Norway', 'native' => 'Norge'],
        ['slug' => 'OM', 'title' => 'Oman', 'native' => 'عُمان'],
        ['slug' => 'PK', 'title' => 'Pakistan', 'native' => 'پاکستان'],
        ['slug' => 'PW', 'title' => 'Palau', 'native' => ''],
        ['slug' => 'PS', 'title' => 'Palestine', 'native' => 'فلسطين'],
        ['slug' => 'PA', 'title' => 'Panama', 'native' => ''],
        ['slug' => 'PG', 'title' => 'Papua New Guinea', 'native' => ''],
        ['slug' => 'PY', 'title' => 'Paraguay', 'native' => ''],
        ['slug' => 'PE', 'title' => 'Peru', 'native' => 'Perú'],
        ['slug' => 'PH', 'title' => 'Philippines', 'native' => ''],
        ['slug' => 'PN', 'title' => 'Pitcairn Islands', 'native' => ''],
        ['slug' => 'PL', 'title' => 'Poland', 'native' => 'Polska'],
        ['slug' => 'PT', 'title' => 'Portugal', 'native' => ''],
        ['slug' => 'PR', 'title' => 'Puerto Rico', 'native' => ''],
        ['slug' => 'QA', 'title' => 'Qatar', 'native' => 'قطر'],
        ['slug' => 'RE', 'title' => 'Réunion', 'native' => 'La Réunion'],
        ['slug' => 'RO', 'title' => 'Romania', 'native' => 'România'],
        ['slug' => 'RU', 'title' => 'Russia', 'native' => 'Россия'],
        ['slug' => 'RW', 'title' => 'Rwanda', 'native' => ''],
        ['slug' => 'BL', 'title' => 'Saint Barthélemy', 'native' => 'Saint-Barthélemy'],
        ['slug' => 'SH', 'title' => 'Saint Helena', 'native' => ''],
        ['slug' => 'KN', 'title' => 'Saint Kitts and Nevis', 'native' => ''],
        ['slug' => 'LC', 'title' => 'Saint Lucia', 'native' => ''],
        ['slug' => 'MF', 'title' => 'Saint Martin', 'native' => ''],
        ['slug' => 'PM', 'title' => 'Saint Pierre and Miquelon', 'native' => 'Saint-Pierre-et-Miquelon'],
        ['slug' => 'WS', 'title' => 'Samoa', 'native' => ''],
        ['slug' => 'SM', 'title' => 'San Marino', 'native' => ''],
        ['slug' => 'ST', 'title' => 'São Tomé and Príncipe', 'native' => 'São Tomé e Príncipe'],
        ['slug' => 'SA', 'title' => 'Saudi Arabia', 'native' => 'المملكة العربية السعودية'],
        ['slug' => 'SN', 'title' => 'Senegal', 'native' => 'Sénégal'],
        ['slug' => 'RS', 'title' => 'Serbia', 'native' => 'Србија'],
        ['slug' => 'SC', 'title' => 'Seychelles', 'native' => ''],
        ['slug' => 'SL', 'title' => 'Sierra Leone', 'native' => ''],
        ['slug' => 'SG', 'title' => 'Singapore', 'native' => ''],
        ['slug' => 'SX', 'title' => 'Sint Maarten', 'native' => ''],
        ['slug' => 'SK', 'title' => 'Slovakia', 'native' => 'Slovensko'],
        ['slug' => 'SI', 'title' => 'Slovenia', 'native' => 'Slovenija'],
        ['slug' => 'SB', 'title' => 'Solomon Islands', 'native' => ''],
        ['slug' => 'SO', 'title' => 'Somalia', 'native' => 'Soomaaliya'],
        ['slug' => 'ZA', 'title' => 'South Africa', 'native' => ''],
        ['slug' => 'GS', 'title' => 'South Georgia & South Sandwich Islands', 'native' => ''],
        ['slug' => 'KR', 'title' => 'South Korea', 'native' => '대한민국'],
        ['slug' => 'SS', 'title' => 'South Sudan', 'native' => 'جنوب السودان'],
        ['slug' => 'ES', 'title' => 'Spain', 'native' => 'España'],
        ['slug' => 'LK', 'title' => 'Sri Lanka', 'native' => 'ශ්‍රී ලංකාව'],
        ['slug' => 'VC', 'title' => 'St. Vincent & Grenadines', 'native' => ''],
        ['slug' => 'SD', 'title' => 'Sudan', 'native' => 'السودان'],
        ['slug' => 'SR', 'title' => 'Suriname', 'native' => ''],
        ['slug' => 'SJ', 'title' => 'Svalbard and Jan Mayen', 'native' => 'Svalbard og Jan Mayen'],
        ['slug' => 'SZ', 'title' => 'Swaziland', 'native' => ''],
        ['slug' => 'SE', 'title' => 'Sweden', 'native' => 'Sverige'],
        ['slug' => 'CH', 'title' => 'Switzerland', 'native' => 'Schweiz'],
        ['slug' => 'SY', 'title' => 'Syria', 'native' => 'سوريا'],
        ['slug' => 'TW', 'title' => 'Taiwan', 'native' => '台灣'],
        ['slug' => 'TJ', 'title' => 'Tajikistan', 'native' => ''],
        ['slug' => 'TZ', 'title' => 'Tanzania', 'native' => ''],
        ['slug' => 'TH', 'title' => 'Thailand', 'native' => 'ไทย'],
        ['slug' => 'TL', 'title' => 'Timor-Leste', 'native' => ''],
        ['slug' => 'TG', 'title' => 'Togo', 'native' => ''],
        ['slug' => 'TK', 'title' => 'Tokelau', 'native' => ''],
        ['slug' => 'TO', 'title' => 'Tonga', 'native' => ''],
        ['slug' => 'TT', 'title' => 'Trinidad and Tobago', 'native' => ''],
        ['slug' => 'TA', 'title' => 'Tristan da Cunha', 'native' => ''],
        ['slug' => 'TN', 'title' => 'Tunisia', 'native' => 'تونس'],
        ['slug' => 'TR', 'title' => 'Turkey', 'native' => 'Türkiye'],
        ['slug' => 'TM', 'title' => 'Turkmenistan', 'native' => ''],
        ['slug' => 'TC', 'title' => 'Turks and Caicos Islands', 'native' => ''],
        ['slug' => 'TV', 'title' => 'Tuvalu', 'native' => ''],
        ['slug' => 'UM', 'title' => 'U.S. Outlying Islands', 'native' => ''],
        ['slug' => 'VI', 'title' => 'U.S. Virgin Islands', 'native' => ''],
        ['slug' => 'UG', 'title' => 'Uganda', 'native' => ''],
        ['slug' => 'UA', 'title' => 'Ukraine', 'native' => 'Україна'],
        ['slug' => 'AE', 'title' => 'United Arab Emirates', 'native' => 'الإمارات العربية المتحدة'],
        ['slug' => 'GB', 'title' => 'United Kingdom', 'native' => ''],
        ['slug' => 'US', 'title' => 'United States', 'native' => ''],
        ['slug' => 'UY', 'title' => 'Uruguay', 'native' => ''],
        ['slug' => 'UZ', 'title' => 'Uzbekistan', 'native' => 'Oʻzbekiston'],
        ['slug' => 'VU', 'title' => 'Vanuatu', 'native' => ''],
        ['slug' => 'VA', 'title' => 'Vatican City', 'native' => 'Città del Vaticano'],
        ['slug' => 'VE', 'title' => 'Venezuela', 'native' => ''],
        ['slug' => 'VN', 'title' => 'Vietnam', 'native' => 'Việt Nam'],
        ['slug' => 'WF', 'title' => 'Wallis and Futuna', 'native' => ''],
        ['slug' => 'EH', 'title' => 'Western Sahara', 'native' => 'الصحراء الغربية'],
        ['slug' => 'YE', 'title' => 'Yemen', 'native' => 'اليمن'],
        ['slug' => 'ZM', 'title' => 'Zambia', 'native' => ''],
        ['slug' => 'ZW', 'title' => 'Zimbabwe', 'native' => '']
    );
    DB::table('data_location_country')->insert($data);
    $country_us = DB::table('data_location_country')->select('id')->where('slug', '=', 'US')->first();
@Ironmunya

This comment has been minimized.

Ironmunya commented Apr 8, 2016

how can i write function for get_country (id)` - Getting the country on its ID.

@milosh-96

This comment has been minimized.

milosh-96 commented May 8, 2016

Thank you very much.

@dumconstantin

This comment has been minimized.

dumconstantin commented May 31, 2016

Thank you!

@RZulmeta

This comment has been minimized.

RZulmeta commented Aug 8, 2016

makasih banyak!

@chernandezenigmind

This comment has been minimized.

chernandezenigmind commented Sep 1, 2016

Thank you!!

@byJeevan

This comment has been minimized.

byJeevan commented Oct 6, 2016

Saved my Time!... Thanks all.. Happy coding... :-)

@mkharoub

This comment has been minimized.

mkharoub commented Oct 6, 2016

Array of all countries in English & Arabic

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

$countryList = array(
"AW" => "آروبا",
"AZ" => "أذربيجان",
"AM" => "أرمينيا",
"ES" => "أسبانيا",
"AU" => "أستراليا",
"AF" => "أفغانستان",
"AL" => "ألبانيا",
"DE" => "ألمانيا",
"AG" => "أنتيجوا وبربودا",
"AO" => "أنجولا",
"AI" => "أنجويلا",
"AD" => "أندورا",
"UY" => "أورجواي",
"UZ" => "أوزبكستان",
"UG" => "أوغندا",
"UA" => "أوكرانيا",
"IE" => "أيرلندا",
"IS" => "أيسلندا",
"ET" => "اثيوبيا",
"ER" => "اريتريا",
"EE" => "استونيا",
"IL" => "اسرائيل",
"AR" => "الأرجنتين",
"JO" => "الأردن",
"EC" => "الاكوادور",
"AE" => "الامارات العربية المتحدة",
"BS" => "الباهاما",
"BH" => "البحرين",
"BR" => "البرازيل",
"PT" => "البرتغال",
"BA" => "البوسنة والهرسك",
"GA" => "الجابون",
"ME" => "الجبل الأسود",
"DZ" => "الجزائر",
"DK" => "الدانمرك",
"CV" => "الرأس الأخضر",
"SV" => "السلفادور",
"SN" => "السنغال",
"SD" => "السودان",
"SE" => "السويد",
"EH" => "الصحراء الغربية",
"SO" => "الصومال",
"CN" => "الصين",
"IQ" => "العراق",
"VA" => "الفاتيكان",
"PH" => "الفيلبين",
"AQ" => "القطب الجنوبي",
"CM" => "الكاميرون",
"CG" => "الكونغو - برازافيل",
"KW" => "الكويت",
"HU" => "المجر",
"IO" => "المحيط الهندي البريطاني",
"MA" => "المغرب",
"TF" => "المقاطعات الجنوبية الفرنسية",
"MX" => "المكسيك",
"SA" => "المملكة العربية السعودية",
"GB" => "المملكة المتحدة",
"NO" => "النرويج",
"AT" => "النمسا",
"NE" => "النيجر",
"IN" => "الهند",
"US" => "الولايات المتحدة الأمريكية",
"JP" => "اليابان",
"YE" => "اليمن",
"GR" => "اليونان",
"ID" => "اندونيسيا",
"IR" => "ايران",
"IT" => "ايطاليا",
"PG" => "بابوا غينيا الجديدة",
"PY" => "باراجواي",
"PK" => "باكستان",
"PW" => "بالاو",
"BW" => "بتسوانا",
"PN" => "بتكايرن",
"BB" => "بربادوس",
"BM" => "برمودا",
"BN" => "بروناي",
"BE" => "بلجيكا",
"BG" => "بلغاريا",
"BZ" => "بليز",
"BD" => "بنجلاديش",
"PA" => "بنما",
"BJ" => "بنين",
"BT" => "بوتان",
"PR" => "بورتوريكو",
"BF" => "بوركينا فاسو",
"BI" => "بوروندي",
"PL" => "بولندا",
"BO" => "بوليفيا",
"PF" => "بولينيزيا الفرنسية",
"PE" => "بيرو",
"TZ" => "تانزانيا",
"TH" => "تايلند",
"TW" => "تايوان",
"TM" => "تركمانستان",
"TR" => "تركيا",
"TT" => "ترينيداد وتوباغو",
"TD" => "تشاد",
"TG" => "توجو",
"TV" => "توفالو",
"TK" => "توكيلو",
"TO" => "تونجا",
"TN" => "تونس",
"TL" => "تيمور الشرقية",
"JM" => "جامايكا",
"GI" => "جبل طارق",
"GD" => "جرينادا",
"GL" => "جرينلاند",
"AX" => "جزر أولان",
"AN" => "جزر الأنتيل الهولندية",
"TC" => "جزر الترك وجايكوس",
"KM" => "جزر القمر",
"KY" => "جزر الكايمن",
"MH" => "جزر المارشال",
"MV" => "جزر الملديف",
"UM" => "جزر الولايات المتحدة البعيدة الصغيرة",
"SB" => "جزر سليمان",
"FO" => "جزر فارو",
"VI" => "جزر فرجين الأمريكية",
"VG" => "جزر فرجين البريطانية",
"FK" => "جزر فوكلاند",
"CK" => "جزر كوك",
"CC" => "جزر كوكوس",
"MP" => "جزر ماريانا الشمالية",
"WF" => "جزر والس وفوتونا",
"CX" => "جزيرة الكريسماس",
"BV" => "جزيرة بوفيه",
"IM" => "جزيرة مان",
"NF" => "جزيرة نورفوك",
"HM" => "جزيرة هيرد وماكدونالد",
"CF" => "جمهورية افريقيا الوسطى",
"CZ" => "جمهورية التشيك",
"DO" => "جمهورية الدومينيك",
"CD" => "جمهورية الكونغو الديمقراطية",
"ZA" => "جمهورية جنوب افريقيا",
"GT" => "جواتيمالا",
"GP" => "جوادلوب",
"GU" => "جوام",
"GE" => "جورجيا",
"GS" => "جورجيا الجنوبية وجزر ساندويتش الجنوبية",
"DJ" => "جيبوتي",
"JE" => "جيرسي",
"DM" => "دومينيكا",
"RW" => "رواندا",
"RU" => "روسيا",
"BY" => "روسيا البيضاء",
"RO" => "رومانيا",
"RE" => "روينيون",
"ZM" => "زامبيا",
"ZW" => "زيمبابوي",
"CI" => "ساحل العاج",
"WS" => "ساموا",
"AS" => "ساموا الأمريكية",
"SM" => "سان مارينو",
"PM" => "سانت بيير وميكولون",
"VC" => "سانت فنسنت وغرنادين",
"KN" => "سانت كيتس ونيفيس",
"LC" => "سانت لوسيا",
"MF" => "سانت مارتين",
"SH" => "سانت هيلنا",
"ST" => "ساو تومي وبرينسيبي",
"LK" => "سريلانكا",
"SJ" => "سفالبارد وجان مايان",
"SK" => "سلوفاكيا",
"SI" => "سلوفينيا",
"SG" => "سنغافورة",
"SZ" => "سوازيلاند",
"SY" => "سوريا",
"SR" => "سورينام",
"CH" => "سويسرا",
"SL" => "سيراليون",
"SC" => "سيشل",
"CL" => "شيلي",
"RS" => "صربيا",
"CS" => "صربيا والجبل الأسود",
"TJ" => "طاجكستان",
"OM" => "عمان",
"GM" => "غامبيا",
"GH" => "غانا",
"GF" => "غويانا",
"GY" => "غيانا",
"GN" => "غينيا",
"GQ" => "غينيا الاستوائية",
"GW" => "غينيا بيساو",
"VU" => "فانواتو",
"FR" => "فرنسا",
"PS" => "فلسطين",
"VE" => "فنزويلا",
"FI" => "فنلندا",
"VN" => "فيتنام",
"FJ" => "فيجي",
"CY" => "قبرص",
"KG" => "قرغيزستان",
"QA" => "قطر",
"KZ" => "كازاخستان",
"NC" => "كاليدونيا الجديدة",
"HR" => "كرواتيا",
"KH" => "كمبوديا",
"CA" => "كندا",
"CU" => "كوبا",
"KR" => "كوريا الجنوبية",
"KP" => "كوريا الشمالية",
"CR" => "كوستاريكا",
"CO" => "كولومبيا",
"KI" => "كيريباتي",
"KE" => "كينيا",
"LV" => "لاتفيا",
"LA" => "لاوس",
"LB" => "لبنان",
"LU" => "لوكسمبورج",
"LY" => "ليبيا",
"LR" => "ليبيريا",
"LT" => "ليتوانيا",
"LI" => "ليختنشتاين",
"LS" => "ليسوتو",
"MQ" => "مارتينيك",
"MO" => "ماكاو الصينية",
"MT" => "مالطا",
"ML" => "مالي",
"MY" => "ماليزيا",
"YT" => "مايوت",
"MG" => "مدغشقر",
"EG" => "مصر",
"MK" => "مقدونيا",
"MW" => "ملاوي",
"ZZ" => "منطقة غير معرفة",
"MN" => "منغوليا",
"MR" => "موريتانيا",
"MU" => "موريشيوس",
"MZ" => "موزمبيق",
"MD" => "مولدافيا",
"MC" => "موناكو",
"MS" => "مونتسرات",
"MM" => "ميانمار",
"FM" => "ميكرونيزيا",
"NA" => "ناميبيا",
"NR" => "نورو",
"NP" => "نيبال",
"NG" => "نيجيريا",
"NI" => "نيكاراجوا",
"NZ" => "نيوزيلاندا",
"NU" => "نيوي",
"HT" => "هايتي",
"HN" => "هندوراس",
"NL" => "هولندا",
"HK" => "هونج كونج الصينية",
);

@califat

This comment has been minimized.

califat commented Nov 25, 2016

All theese ideas are awesome

@thegirlinthecafe

This comment has been minimized.

thegirlinthecafe commented Jan 7, 2017

Thank you all you lovely people! This saves so much time! :-)

@hassanskylinxtech

This comment has been minimized.

hassanskylinxtech commented Jul 24, 2017

Thanks so much

@theenoahmason

This comment has been minimized.

theenoahmason commented Jul 27, 2017

For WordPress, with filter and translatable country names

<?php 
/**
 * Get Countries (WordPress)
 * 
 * Get translated Countries in WordPress. Runs output through a 
 * filter before returning to allow for customization through third
 * party plugins and themes, or for select removal/modification/addition 
 * of countries for whatever reason.
 * 
 * Function Usage: 
 * search and replace all instances of `example` and replace it with your 
 * theme or plugin's textdomain (example:twentyseventeen). Then call as:
 * $countries = example_get_countries();
 * 
 * Filter Usage:
 * function example_countries_filter( $countries ) {
 * 		// add a translatable country:
 * 		$countries['XX'] = __( 'Country Name', 'example' );
 * 		// remove a country:
 * 		unset( $countries['YY'] );
 *		// modify a country:
 *		$countries['US'] = __( 'America, F*ck Yeah.', 'example' );
 * 		// always return countries!
 * 		return $countries;
 * }
 * add_filter( 'example_countries_filters', 'example_countries_filter', 10 );
 * 
 * @link https://developer.wordpress.org/themes/functionality/internationalization/
 * @link https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/
 * @link https://developer.wordpress.org/reference/functions/__/
 * @link https://developer.wordpress.org/plugins/hooks/filters/
 * @link https://developer.wordpress.org/reference/functions/apply_filters/
 * @link https://developer.wordpress.org/reference/functions/add_filter/
 * 
 * @return array Countries as Country code => Country name
 */
function example_get_countries() {

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

	/**
	 * Return the translated and filtered countries
	 */
	return $countries;
}
@tacic

This comment has been minimized.

tacic commented Sep 13, 2017

Thank you. Pretty useful... That saves my day of checking an listing all the countries...

@ghost

This comment has been minimized.

ghost commented Sep 26, 2017

Thank you

@tattali

This comment has been minimized.

tattali commented Oct 16, 2017

iso_alpha_2 and translation en-fr

$countryList = array(
    'AD' => array('en' => 'Andorra', 'fr' => 'Andorre'), 
    'AE' => array('en' => 'United Arab Emirates', 'fr' => 'Émirats arabes unis'), 
    'AF' => array('en' => 'Afghanistan', 'fr' => 'Afghanistan'), 
    'AG' => array('en' => 'Antigua and Barbuda', 'fr' => 'Antigua-et-Barbuda'), 
    'AI' => array('en' => 'Anguilla', 'fr' => 'Anguilla'), 
    'AL' => array('en' => 'Albania', 'fr' => 'Albanie'), 
    'AM' => array('en' => 'Armenia', 'fr' => 'Arménie'), 
    'AN' => array('en' => 'Netherlands Antilles', 'fr' => 'Antilles néerlandaises'), 
    'AO' => array('en' => 'Angola', 'fr' => 'Angola'), 
    'AQ' => array('en' => 'Antarctica', 'fr' => 'Antarctique'), 
    'AR' => array('en' => 'Argentina', 'fr' => 'Argentine'), 
    'AS' => array('en' => 'American Samoa', 'fr' => 'Samoa américaines'), 
    'AT' => array('en' => 'Austria', 'fr' => 'Autriche'), 
    'AU' => array('en' => 'Australia', 'fr' => 'Australie'), 
    'AW' => array('en' => 'Aruba', 'fr' => 'Aruba'), 
    'AX' => array('en' => 'Åland Islands', 'fr' => 'Îles Åland'), 
    'AZ' => array('en' => 'Azerbaijan', 'fr' => 'Azerbaïdjan'), 
    'BA' => array('en' => 'Bosnia and Herzegovina', 'fr' => 'Bosnie-Herzégovine'), 
    'BB' => array('en' => 'Barbados', 'fr' => 'Barbade'), 
    'BD' => array('en' => 'Bangladesh', 'fr' => 'Bangladesh'), 
    'BE' => array('en' => 'Belgium', 'fr' => 'Belgique'), 
    'BF' => array('en' => 'Burkina Faso', 'fr' => 'Burkina Faso'), 
    'BG' => array('en' => 'Bulgaria', 'fr' => 'Bulgarie'), 
    'BH' => array('en' => 'Bahrain', 'fr' => 'Bahreïn'), 
    'BI' => array('en' => 'Burundi', 'fr' => 'Burundi'), 
    'BJ' => array('en' => 'Benin', 'fr' => 'Bénin'), 
    'BL' => array('en' => 'Saint Barthélemy', 'fr' => 'Saint-Barthélémy'), 
    'BM' => array('en' => 'Bermuda', 'fr' => 'Bermudes'), 
    'BN' => array('en' => 'Brunei', 'fr' => 'Brunéi Darussalam'), 
    'BO' => array('en' => 'Bolivia', 'fr' => 'Bolivie'), 
    'BR' => array('en' => 'Brazil', 'fr' => 'Brésil'), 
    'BS' => array('en' => 'Bahamas', 'fr' => 'Bahamas'), 
    'BT' => array('en' => 'Bhutan', 'fr' => 'Bhoutan'), 
    'BV' => array('en' => 'Bouvet Island', 'fr' => 'Île Bouvet'), 
    'BW' => array('en' => 'Botswana', 'fr' => 'Botswana'), 
    'BY' => array('en' => 'Belarus', 'fr' => 'Bélarus'), 
    'BZ' => array('en' => 'Belize', 'fr' => 'Belize'), 
    'CA' => array('en' => 'Canada', 'fr' => 'Canada'), 
    'CC' => array('en' => 'Cocos [Keeling] Islands', 'fr' => 'Îles Cocos - Keeling'), 
    'CD' => array('en' => 'Congo - Kinshasa', 'fr' => 'République démocratique du Congo'), 
    'CF' => array('en' => 'Central African Republic', 'fr' => 'République centrafricaine'), 
    'CG' => array('en' => 'Congo - Brazzaville', 'fr' => 'Congo'), 
    'CH' => array('en' => 'Switzerland', 'fr' => 'Suisse'), 
    'CI' => array('en' => 'Côte d’Ivoire', 'fr' => 'Côte d’Ivoire'), 
    'CK' => array('en' => 'Cook Islands', 'fr' => 'Îles Cook'), 
    'CL' => array('en' => 'Chile', 'fr' => 'Chili'), 
    'CM' => array('en' => 'Cameroon', 'fr' => 'Cameroun'), 
    'CN' => array('en' => 'China', 'fr' => 'Chine'), 
    'CO' => array('en' => 'Colombia', 'fr' => 'Colombie'), 
    'CR' => array('en' => 'Costa Rica', 'fr' => 'Costa Rica'), 
    'CU' => array('en' => 'Cuba', 'fr' => 'Cuba'), 
    'CV' => array('en' => 'Cape Verde', 'fr' => 'Cap-Vert'), 
    'CX' => array('en' => 'Christmas Island', 'fr' => 'Île Christmas'), 
    'CY' => array('en' => 'Cyprus', 'fr' => 'Chypre'), 
    'CZ' => array('en' => 'Czech Republic', 'fr' => 'République tchèque'), 
    'DE' => array('en' => 'Germany', 'fr' => 'Allemagne'), 
    'DJ' => array('en' => 'Djibouti', 'fr' => 'Djibouti'), 
    'DK' => array('en' => 'Denmark', 'fr' => 'Danemark'), 
    'DM' => array('en' => 'Dominica', 'fr' => 'Dominique'), 
    'DO' => array('en' => 'Dominican Republic', 'fr' => 'République dominicaine'), 
    'DZ' => array('en' => 'Algeria', 'fr' => 'Algérie'), 
    'EC' => array('en' => 'Ecuador', 'fr' => 'Équateur'), 
    'EE' => array('en' => 'Estonia', 'fr' => 'Estonie'), 
    'EG' => array('en' => 'Egypt', 'fr' => 'Égypte'), 
    'EH' => array('en' => 'Western Sahara', 'fr' => 'Sahara occidental'), 
    'ER' => array('en' => 'Eritrea', 'fr' => 'Érythrée'), 
    'ES' => array('en' => 'Spain', 'fr' => 'Espagne'), 
    'ET' => array('en' => 'Ethiopia', 'fr' => 'Éthiopie'), 
    'FI' => array('en' => 'Finland', 'fr' => 'Finlande'), 
    'FJ' => array('en' => 'Fiji', 'fr' => 'Fidji'), 
    'FK' => array('en' => 'Falkland Islands', 'fr' => 'Îles Malouines'), 
    'FM' => array('en' => 'Micronesia', 'fr' => 'États fédérés de Micronésie'), 
    'FO' => array('en' => 'Faroe Islands', 'fr' => 'Îles Féroé'), 
    'FR' => array('en' => 'France', 'fr' => 'France'), 
    'GA' => array('en' => 'Gabon', 'fr' => 'Gabon'), 
    'GB' => array('en' => 'United Kingdom', 'fr' => 'Royaume-Uni'), 
    'GD' => array('en' => 'Grenada', 'fr' => 'Grenade'), 
    'GE' => array('en' => 'Georgia', 'fr' => 'Géorgie'), 
    'GF' => array('en' => 'French Guiana', 'fr' => 'Guyane française'), 
    'GG' => array('en' => 'Guernsey', 'fr' => 'Guernesey'), 
    'GH' => array('en' => 'Ghana', 'fr' => 'Ghana'), 
    'GI' => array('en' => 'Gibraltar', 'fr' => 'Gibraltar'), 
    'GL' => array('en' => 'Greenland', 'fr' => 'Groenland'), 
    'GM' => array('en' => 'Gambia', 'fr' => 'Gambie'), 
    'GN' => array('en' => 'Guinea', 'fr' => 'Guinée'), 
    'GP' => array('en' => 'Guadeloupe', 'fr' => 'Guadeloupe'), 
    'GQ' => array('en' => 'Equatorial Guinea', 'fr' => 'Guinée équatoriale'), 
    'GR' => array('en' => 'Greece', 'fr' => 'Grèce'), 
    'GS' => array('en' => 'South Georgia and the South Sandwich Islands', 'fr' => 'Géorgie du Sud et les îles Sandwich du Sud'), 
    'GT' => array('en' => 'Guatemala', 'fr' => 'Guatemala'), 
    'GU' => array('en' => 'Guam', 'fr' => 'Guam'), 
    'GW' => array('en' => 'Guinea-Bissau', 'fr' => 'Guinée-Bissau'), 
    'GY' => array('en' => 'Guyana', 'fr' => 'Guyana'), 
    'HK' => array('en' => 'Hong Kong SAR China', 'fr' => 'R.A.S. chinoise de Hong Kong'), 
    'HM' => array('en' => 'Heard Island and McDonald Islands', 'fr' => 'Îles Heard et MacDonald'), 
    'HN' => array('en' => 'Honduras', 'fr' => 'Honduras'), 
    'HR' => array('en' => 'Croatia', 'fr' => 'Croatie'), 
    'HT' => array('en' => 'Haiti', 'fr' => 'Haïti'), 
    'HU' => array('en' => 'Hungary', 'fr' => 'Hongrie'), 
    'ID' => array('en' => 'Indonesia', 'fr' => 'Indonésie'), 
    'IE' => array('en' => 'Ireland', 'fr' => 'Irlande'), 
    'IL' => array('en' => 'Israel', 'fr' => 'Israël'), 
    'IM' => array('en' => 'Isle of Man', 'fr' => 'Île de Man'), 
    'IN' => array('en' => 'India', 'fr' => 'Inde'), 
    'IO' => array('en' => 'British Indian Ocean Territory', 'fr' => 'Territoire britannique de l\'océan Indien'), 
    'IQ' => array('en' => 'Iraq', 'fr' => 'Irak'), 
    'IR' => array('en' => 'Iran', 'fr' => 'Iran'), 
    'IS' => array('en' => 'Iceland', 'fr' => 'Islande'), 
    'IT' => array('en' => 'Italy', 'fr' => 'Italie'), 
    'JE' => array('en' => 'Jersey', 'fr' => 'Jersey'), 
    'JM' => array('en' => 'Jamaica', 'fr' => 'Jamaïque'), 
    'JO' => array('en' => 'Jordan', 'fr' => 'Jordanie'), 
    'JP' => array('en' => 'Japan', 'fr' => 'Japon'), 
    'KE' => array('en' => 'Kenya', 'fr' => 'Kenya'), 
    'KG' => array('en' => 'Kyrgyzstan', 'fr' => 'Kirghizistan'), 
    'KH' => array('en' => 'Cambodia', 'fr' => 'Cambodge'), 
    'KI' => array('en' => 'Kiribati', 'fr' => 'Kiribati'), 
    'KM' => array('en' => 'Comoros', 'fr' => 'Comores'), 
    'KN' => array('en' => 'Saint Kitts and Nevis', 'fr' => 'Saint-Kitts-et-Nevis'), 
    'KP' => array('en' => 'North Korea', 'fr' => 'Corée du Nord'), 
    'KR' => array('en' => 'South Korea', 'fr' => 'Corée du Sud'), 
    'KW' => array('en' => 'Kuwait', 'fr' => 'Koweït'), 
    'KY' => array('en' => 'Cayman Islands', 'fr' => 'Îles Caïmans'), 
    'KZ' => array('en' => 'Kazakhstan', 'fr' => 'Kazakhstan'), 
    'LA' => array('en' => 'Laos', 'fr' => 'Laos'), 
    'LB' => array('en' => 'Lebanon', 'fr' => 'Liban'), 
    'LC' => array('en' => 'Saint Lucia', 'fr' => 'Sainte-Lucie'), 
    'LI' => array('en' => 'Liechtenstein', 'fr' => 'Liechtenstein'), 
    'LK' => array('en' => 'Sri Lanka', 'fr' => 'Sri Lanka'), 
    'LR' => array('en' => 'Liberia', 'fr' => 'Libéria'), 
    'LS' => array('en' => 'Lesotho', 'fr' => 'Lesotho'), 
    'LT' => array('en' => 'Lithuania', 'fr' => 'Lituanie'), 
    'LU' => array('en' => 'Luxembourg', 'fr' => 'Luxembourg'), 
    'LV' => array('en' => 'Latvia', 'fr' => 'Lettonie'), 
    'LY' => array('en' => 'Libya', 'fr' => 'Libye'), 
    'MA' => array('en' => 'Morocco', 'fr' => 'Maroc'), 
    'MC' => array('en' => 'Monaco', 'fr' => 'Monaco'), 
    'MD' => array('en' => 'Moldova', 'fr' => 'Moldavie'), 
    'ME' => array('en' => 'Montenegro', 'fr' => 'Monténégro'), 
    'MF' => array('en' => 'Saint Martin', 'fr' => 'Saint-Martin'), 
    'MG' => array('en' => 'Madagascar', 'fr' => 'Madagascar'), 
    'MH' => array('en' => 'Marshall Islands', 'fr' => 'Îles Marshall'), 
    'MK' => array('en' => 'Macedonia', 'fr' => 'Macédoine'), 
    'ML' => array('en' => 'Mali', 'fr' => 'Mali'), 
    'MM' => array('en' => 'Myanmar [Burma]', 'fr' => 'Myanmar'), 
    'MN' => array('en' => 'Mongolia', 'fr' => 'Mongolie'), 
    'MO' => array('en' => 'Macau SAR China', 'fr' => 'R.A.S. chinoise de Macao'), 
    'MP' => array('en' => 'Northern Mariana Islands', 'fr' => 'Îles Mariannes du Nord'), 
    'MQ' => array('en' => 'Martinique', 'fr' => 'Martinique'), 
    'MR' => array('en' => 'Mauritania', 'fr' => 'Mauritanie'), 
    'MS' => array('en' => 'Montserrat', 'fr' => 'Montserrat'), 
    'MT' => array('en' => 'Malta', 'fr' => 'Malte'), 
    'MU' => array('en' => 'Mauritius', 'fr' => 'Maurice'), 
    'MV' => array('en' => 'Maldives', 'fr' => 'Maldives'), 
    'MW' => array('en' => 'Malawi', 'fr' => 'Malawi'), 
    'MX' => array('en' => 'Mexico', 'fr' => 'Mexique'), 
    'MY' => array('en' => 'Malaysia', 'fr' => 'Malaisie'), 
    'MZ' => array('en' => 'Mozambique', 'fr' => 'Mozambique'), 
    'NA' => array('en' => 'Namibia', 'fr' => 'Namibie'), 
    'NC' => array('en' => 'New Caledonia', 'fr' => 'Nouvelle-Calédonie'), 
    'NE' => array('en' => 'Niger', 'fr' => 'Niger'), 
    'NF' => array('en' => 'Norfolk Island', 'fr' => 'Île Norfolk'), 
    'NG' => array('en' => 'Nigeria', 'fr' => 'Nigéria'), 
    'NI' => array('en' => 'Nicaragua', 'fr' => 'Nicaragua'), 
    'NL' => array('en' => 'Netherlands', 'fr' => 'Pays-Bas'), 
    'NO' => array('en' => 'Norway', 'fr' => 'Norvège'), 
    'NP' => array('en' => 'Nepal', 'fr' => 'Népal'), 
    'NR' => array('en' => 'Nauru', 'fr' => 'Nauru'), 
    'NU' => array('en' => 'Niue', 'fr' => 'Niue'), 
    'NZ' => array('en' => 'New Zealand', 'fr' => 'Nouvelle-Zélande'), 
    'OM' => array('en' => 'Oman', 'fr' => 'Oman'), 
    'PA' => array('en' => 'Panama', 'fr' => 'Panama'), 
    'PE' => array('en' => 'Peru', 'fr' => 'Pérou'), 
    'PF' => array('en' => 'French Polynesia', 'fr' => 'Polynésie française'), 
    'PG' => array('en' => 'Papua New Guinea', 'fr' => 'Papouasie-Nouvelle-Guinée'), 
    'PH' => array('en' => 'Philippines', 'fr' => 'Philippines'), 
    'PK' => array('en' => 'Pakistan', 'fr' => 'Pakistan'), 
    'PL' => array('en' => 'Poland', 'fr' => 'Pologne'), 
    'PM' => array('en' => 'Saint Pierre and Miquelon', 'fr' => 'Saint-Pierre-et-Miquelon'), 
    'PN' => array('en' => 'Pitcairn Islands', 'fr' => 'Pitcairn'), 
    'PR' => array('en' => 'Puerto Rico', 'fr' => 'Porto Rico'), 
    'PS' => array('en' => 'Palestinian Territories', 'fr' => 'Territoire palestinien'), 
    'PT' => array('en' => 'Portugal', 'fr' => 'Portugal'), 
    'PW' => array('en' => 'Palau', 'fr' => 'Palaos'), 
    'PY' => array('en' => 'Paraguay', 'fr' => 'Paraguay'), 
    'QA' => array('en' => 'Qatar', 'fr' => 'Qatar'), 
    'RE' => array('en' => 'Réunion', 'fr' => 'Réunion'), 
    'RO' => array('en' => 'Romania', 'fr' => 'Roumanie'), 
    'RS' => array('en' => 'Serbia', 'fr' => 'Serbie'), 
    'RU' => array('en' => 'Russia', 'fr' => 'Russie'), 
    'RW' => array('en' => 'Rwanda', 'fr' => 'Rwanda'), 
    'SA' => array('en' => 'Saudi Arabia', 'fr' => 'Arabie saoudite'), 
    'SB' => array('en' => 'Solomon Islands', 'fr' => 'Îles Salomon'), 
    'SC' => array('en' => 'Seychelles', 'fr' => 'Seychelles'), 
    'SD' => array('en' => 'Sudan', 'fr' => 'Soudan'), 
    'SE' => array('en' => 'Sweden', 'fr' => 'Suède'), 
    'SG' => array('en' => 'Singapore', 'fr' => 'Singapour'), 
    'SH' => array('en' => 'Saint Helena', 'fr' => 'Sainte-Hélène'), 
    'SI' => array('en' => 'Slovenia', 'fr' => 'Slovénie'), 
    'SJ' => array('en' => 'Svalbard and Jan Mayen', 'fr' => 'Svalbard et Île Jan Mayen'), 
    'SK' => array('en' => 'Slovakia', 'fr' => 'Slovaquie'), 
    'SL' => array('en' => 'Sierra Leone', 'fr' => 'Sierra Leone'), 
    'SM' => array('en' => 'San Marino', 'fr' => 'Saint-Marin'), 
    'SN' => array('en' => 'Senegal', 'fr' => 'Sénégal'), 
    'SO' => array('en' => 'Somalia', 'fr' => 'Somalie'), 
    'SR' => array('en' => 'Suriname', 'fr' => 'Suriname'), 
    'ST' => array('en' => 'São Tomé and Príncipe', 'fr' => 'Sao Tomé-et-Principe'), 
    'SV' => array('en' => 'El Salvador', 'fr' => 'El Salvador'), 
    'SY' => array('en' => 'Syria', 'fr' => 'Syrie'), 
    'SZ' => array('en' => 'Swaziland', 'fr' => 'Swaziland'), 
    'TC' => array('en' => 'Turks and Caicos Islands', 'fr' => 'Îles Turks et Caïques'), 
    'TD' => array('en' => 'Chad', 'fr' => 'Tchad'), 
    'TF' => array('en' => 'French Southern Territories', 'fr' => 'Terres australes françaises'), 
    'TG' => array('en' => 'Togo', 'fr' => 'Togo'), 
    'TH' => array('en' => 'Thailand', 'fr' => 'Thaïlande'), 
    'TJ' => array('en' => 'Tajikistan', 'fr' => 'Tadjikistan'), 
    'TK' => array('en' => 'Tokelau', 'fr' => 'Tokelau'), 
    'TL' => array('en' => 'Timor-Leste', 'fr' => 'Timor oriental'), 
    'TM' => array('en' => 'Turkmenistan', 'fr' => 'Turkménistan'), 
    'TN' => array('en' => 'Tunisia', 'fr' => 'Tunisie'), 
    'TO' => array('en' => 'Tonga', 'fr' => 'Tonga'), 
    'TR' => array('en' => 'Turkey', 'fr' => 'Turquie'), 
    'TT' => array('en' => 'Trinidad and Tobago', 'fr' => 'Trinité-et-Tobago'), 
    'TV' => array('en' => 'Tuvalu', 'fr' => 'Tuvalu'), 
    'TW' => array('en' => 'Taiwan', 'fr' => 'Taïwan'), 
    'TZ' => array('en' => 'Tanzania', 'fr' => 'Tanzanie'), 
    'UA' => array('en' => 'Ukraine', 'fr' => 'Ukraine'), 
    'UG' => array('en' => 'Uganda', 'fr' => 'Ouganda'), 
    'UM' => array('en' => 'U.S. Minor Outlying Islands', 'fr' => 'Îles Mineures Éloignées des États-Unis'), 
    'US' => array('en' => 'United States', 'fr' => 'États-Unis'), 
    'UY' => array('en' => 'Uruguay', 'fr' => 'Uruguay'), 
    'UZ' => array('en' => 'Uzbekistan', 'fr' => 'Ouzbékistan'), 
    'VA' => array('en' => 'Vatican City', 'fr' => 'État de la Cité du Vatican'), 
    'VC' => array('en' => 'Saint Vincent and the Grenadines', 'fr' => 'Saint-Vincent-et-les Grenadines'), 
    'VE' => array('en' => 'Venezuela', 'fr' => 'Venezuela'), 
    'VG' => array('en' => 'British Virgin Islands', 'fr' => 'Îles Vierges britanniques'), 
    'VI' => array('en' => 'U.S. Virgin Islands', 'fr' => 'Îles Vierges des États-Unis'), 
    'VN' => array('en' => 'Vietnam', 'fr' => 'Viêt Nam'), 
    'VU' => array('en' => 'Vanuatu', 'fr' => 'Vanuatu'), 
    'WF' => array('en' => 'Wallis and Futuna', 'fr' => 'Wallis-et-Futuna'), 
    'WS' => array('en' => 'Samoa', 'fr' => 'Samoa'), 
    'YE' => array('en' => 'Yemen', 'fr' => 'Yémen'), 
    'YT' => array('en' => 'Mayotte', 'fr' => 'Mayotte'), 
    'ZA' => array('en' => 'South Africa', 'fr' => 'Afrique du Sud'), 
    'ZM' => array('en' => 'Zambia', 'fr' => 'Zambie'), 
    'ZW' => array('en' => 'Zimbabwe', 'fr' => 'Zimbabwe')
);
@iresci23

This comment has been minimized.

iresci23 commented Jan 17, 2018

For those looking for a free REST service: https://restcountries.eu

@monkeymonk

This comment has been minimized.

monkeymonk commented Jan 24, 2018

@milosb793

This comment has been minimized.

milosb793 commented Jan 29, 2018

Thanks everybody! <3

@slaFFik

This comment has been minimized.

slaFFik commented Jan 30, 2018

Before using any of those arrays of countries above - check them manually. MOST OF THEM ARE INVALID!
They include regions, that are not countries. Example: Réunion - which is not a country.

Regions !== Countries.

@theenoahmason

This comment has been minimized.

theenoahmason commented Feb 19, 2018

Thanks for the info @slaFFik, Fixed my example above. Any others you can see off hand?

@imchaitanyadesai

This comment has been minimized.

imchaitanyadesai commented Mar 14, 2018

Thank you for this.

@DDiimmkkaass

This comment has been minimized.

DDiimmkkaass commented Apr 14, 2018

thanks a lot

@quangpro1610

This comment has been minimized.

quangpro1610 commented Jun 7, 2018

Thanks you for your help :)

@bucktechnologies

This comment has been minimized.

bucktechnologies commented Oct 26, 2018

i want a country list with code , country name and continent
eg. $country_array = array( "US" => "United States"=>"North America")

@owldesign

This comment has been minimized.

owldesign commented Nov 19, 2018

public $countries = [
        "AF" => ["country" => "Afghanistan", "continent" => "Asia"],
        "AX" => ["country" => "Åland Islands", "continent" => "Europe"],
        "AL" => ["country" => "Albania", "continent" => "Europe"],
        "DZ" => ["country" => "Algeria", "continent" => "Africa"],
        "AS" => ["country" => "American Samoa", "continent" => "Oceania"],
        "AD" => ["country" => "Andorra", "continent" => "Europe"],
        "AO" => ["country" => "Angola", "continent" => "Africa"],
        "AI" => ["country" => "Anguilla", "continent" => "North America"],
        "AQ" => ["country" => "Antarctica", "continent" => "Antarctica"],
        "AG" => ["country" => "Antigua and Barbuda", "continent" => "North America"],
        "AR" => ["country" => "Argentina", "continent" => "South America"],
        "AM" => ["country" => "Armenia", "continent" => "Asia"],
        "AW" => ["country" => "Aruba", "continent" => "North America"],
        "AU" => ["country" => "Australia", "continent" => "Oceania"],
        "AT" => ["country" => "Austria", "continent" => "Europe"],
        "AZ" => ["country" => "Azerbaijan", "continent" => "Asia"],
        "BS" => ["country" => "Bahamas", "continent" => "North America"],
        "BH" => ["country" => "Bahrain", "continent" => "Asia"],
        "BD" => ["country" => "Bangladesh", "continent" => "Asia"],
        "BB" => ["country" => "Barbados", "continent" => "North America"],
        "BY" => ["country" => "Belarus", "continent" => "Europe"],
        "BE" => ["country" => "Belgium", "continent" => "Europe"],
        "BZ" => ["country" => "Belize", "continent" => "North America"],
        "BJ" => ["country" => "Benin", "continent" => "Africa"],
        "BM" => ["country" => "Bermuda", "continent" => "North America"],
        "BT" => ["country" => "Bhutan", "continent" => "Asia"],
        "BO" => ["country" => "Bolivia", "continent" => "South America"],
        "BA" => ["country" => "Bosnia and Herzegovina", "continent" => "Europe"],
        "BW" => ["country" => "Botswana", "continent" => "Africa"],
        "BV" => ["country" => "Bouvet Island", "continent" => "Antarctica"],
        "BR" => ["country" => "Brazil", "continent" => "South America"],
        "IO" => ["country" => "British Indian Ocean Territory", "continent" => "Asia"],
        "BN" => ["country" => "Brunei Darussalam", "continent" => "Asia"],
        "BG" => ["country" => "Bulgaria", "continent" => "Europe"],
        "BF" => ["country" => "Burkina Faso", "continent" => "Africa"],
        "BI" => ["country" => "Burundi", "continent" => "Africa"],
        "KH" => ["country" => "Cambodia", "continent" => "Asia"],
        "CM" => ["country" => "Cameroon", "continent" => "Africa"],
        "CA" => ["country" => "Canada", "continent" => "North America"],
        "CV" => ["country" => "Cape Verde", "continent" => "Africa"],
        "KY" => ["country" => "Cayman Islands", "continent" => "North America"],
        "CF" => ["country" => "Central African Republic", "continent" => "Africa"],
        "TD" => ["country" => "Chad", "continent" => "Africa"],
        "CL" => ["country" => "Chile", "continent" => "South America"],
        "CN" => ["country" => "China", "continent" => "Asia"],
        "CX" => ["country" => "Christmas Island", "continent" => "Asia"],
        "CC" => ["country" => "Cocos (Keeling] Islands", "continent" => "Asia"],
        "CO" => ["country" => "Colombia", "continent" => "South America"],
        "KM" => ["country" => "Comoros", "continent" => "Africa"],
        "CG" => ["country" => "Congo", "continent" => "Africa"],
        "CD" => ["country" => "The Democratic Republic of The Congo", "continent" => "Africa"],
        "CK" => ["country" => "Cook Islands", "continent" => "Oceania"],
        "CR" => ["country" => "Costa Rica", "continent" => "North America"],
        "CI" => ["country" => "Cote D'ivoire", "continent" => "Africa"],
        "HR" => ["country" => "Croatia", "continent" => "Europe"],
        "CU" => ["country" => "Cuba", "continent" => "North America"],
        "CY" => ["country" => "Cyprus", "continent" => "Asia"],
        "CZ" => ["country" => "Czech Republic", "continent" => "Europe"],
        "DK" => ["country" => "Denmark", "continent" => "Europe"],
        "DJ" => ["country" => "Djibouti", "continent" => "Africa"],
        "DM" => ["country" => "Dominica", "continent" => "North America"],
        "DO" => ["country" => "Dominican Republic", "continent" => "North America"],
        "EC" => ["country" => "Ecuador", "continent" => "South America"],
        "EG" => ["country" => "Egypt", "continent" => "Africa"],
        "SV" => ["country" => "El Salvador", "continent" => "North America"],
        "GQ" => ["country" => "Equatorial Guinea", "continent" => "Africa"],
        "ER" => ["country" => "Eritrea", "continent" => "Africa"],
        "EE" => ["country" => "Estonia", "continent" => "Europe"],
        "ET" => ["country" => "Ethiopia", "continent" => "Africa"],
        "FK" => ["country" => "Falkland Islands (Malvinas]", "continent" => "South America"],
        "FO" => ["country" => "Faroe Islands", "continent" => "Europe"],
        "FJ" => ["country" => "Fiji", "continent" => "Oceania"],
        "FI" => ["country" => "Finland", "continent" => "Europe"],
        "FR" => ["country" => "France", "continent" => "Europe"],
        "GF" => ["country" => "French Guiana", "continent" => "South America"],
        "PF" => ["country" => "French Polynesia", "continent" => "Oceania"],
        "TF" => ["country" => "French Southern Territories", "continent" => "Antarctica"],
        "GA" => ["country" => "Gabon", "continent" => "Africa"],
        "GM" => ["country" => "Gambia", "continent" => "Africa"],
        "GE" => ["country" => "Georgia", "continent" => "Asia"],
        "DE" => ["country" => "Germany", "continent" => "Europe"],
        "GH" => ["country" => "Ghana", "continent" => "Africa"],
        "GI" => ["country" => "Gibraltar", "continent" => "Europe"],
        "GR" => ["country" => "Greece", "continent" => "Europe"],
        "GL" => ["country" => "Greenland", "continent" => "North America"],
        "GD" => ["country" => "Grenada", "continent" => "North America"],
        "GP" => ["country" => "Guadeloupe", "continent" => "North America"],
        "GU" => ["country" => "Guam", "continent" => "Oceania"],
        "GT" => ["country" => "Guatemala", "continent" => "North America"],
        "GG" => ["country" => "Guernsey", "continent" => "Europe"],
        "GN" => ["country" => "Guinea", "continent" => "Africa"],
        "GW" => ["country" => "Guinea-bissau", "continent" => "Africa"],
        "GY" => ["country" => "Guyana", "continent" => "South America"],
        "HT" => ["country" => "Haiti", "continent" => "North America"],
        "HM" => ["country" => "Heard Island and Mcdonald Islands", "continent" => "Antarctica"],
        "VA" => ["country" => "Holy See (Vatican City State]", "continent" => "Europe"],
        "HN" => ["country" => "Honduras", "continent" => "North America"],
        "HK" => ["country" => "Hong Kong", "continent" => "Asia"],
        "HU" => ["country" => "Hungary", "continent" => "Europe"],
        "IS" => ["country" => "Iceland", "continent" => "Europe"],
        "IN" => ["country" => "India", "continent" => "Asia"],
        "ID" => ["country" => "Indonesia", "continent" => "Asia"],
        "IR" => ["country" => "Iran", "continent" => "Asia"],
        "IQ" => ["country" => "Iraq", "continent" => "Asia"],
        "IE" => ["country" => "Ireland", "continent" => "Europe"],
        "IM" => ["country" => "Isle of Man", "continent" => "Europe"],
        "IL" => ["country" => "Israel", "continent" => "Asia"],
        "IT" => ["country" => "Italy", "continent" => "Europe"],
        "JM" => ["country" => "Jamaica", "continent" => "North America"],
        "JP" => ["country" => "Japan", "continent" => "Asia"],
        "JE" => ["country" => "Jersey", "continent" => "Europe"],
        "JO" => ["country" => "Jordan", "continent" => "Asia"],
        "KZ" => ["country" => "Kazakhstan", "continent" => "Asia"],
        "KE" => ["country" => "Kenya", "continent" => "Africa"],
        "KI" => ["country" => "Kiribati", "continent" => "Oceania"],
        "KP" => ["country" => "Democratic People's Republic of Korea", "continent" => "Asia"],
        "KR" => ["country" => "Republic of Korea", "continent" => "Asia"],
        "KW" => ["country" => "Kuwait", "continent" => "Asia"],
        "KG" => ["country" => "Kyrgyzstan", "continent" => "Asia"],
        "LA" => ["country" => "Lao People's Democratic Republic", "continent" => "Asia"],
        "LV" => ["country" => "Latvia", "continent" => "Europe"],
        "LB" => ["country" => "Lebanon", "continent" => "Asia"],
        "LS" => ["country" => "Lesotho", "continent" => "Africa"],
        "LR" => ["country" => "Liberia", "continent" => "Africa"],
        "LY" => ["country" => "Libya", "continent" => "Africa"],
        "LI" => ["country" => "Liechtenstein", "continent" => "Europe"],
        "LT" => ["country" => "Lithuania", "continent" => "Europe"],
        "LU" => ["country" => "Luxembourg", "continent" => "Europe"],
        "MO" => ["country" => "Macao", "continent" => "Asia"],
        "MK" => ["country" => "Macedonia", "continent" => "Europe"],
        "MG" => ["country" => "Madagascar", "continent" => "Africa"],
        "MW" => ["country" => "Malawi", "continent" => "Africa"],
        "MY" => ["country" => "Malaysia", "continent" => "Asia"],
        "MV" => ["country" => "Maldives", "continent" => "Asia"],
        "ML" => ["country" => "Mali", "continent" => "Africa"],
        "MT" => ["country" => "Malta", "continent" => "Europe"],
        "MH" => ["country" => "Marshall Islands", "continent" => "Oceania"],
        "MQ" => ["country" => "Martinique", "continent" => "North America"],
        "MR" => ["country" => "Mauritania", "continent" => "Africa"],
        "MU" => ["country" => "Mauritius", "continent" => "Africa"],
        "YT" => ["country" => "Mayotte", "continent" => "Africa"],
        "MX" => ["country" => "Mexico", "continent" => "North America"],
        "FM" => ["country" => "Micronesia", "continent" => "Oceania"],
        "MD" => ["country" => "Moldova", "continent" => "Europe"],
        "MC" => ["country" => "Monaco", "continent" => "Europe"],
        "MN" => ["country" => "Mongolia", "continent" => "Asia"],
        "ME" => ["country" => "Montenegro", "continent" => "Europe"],
        "MS" => ["country" => "Montserrat", "continent" => "North America"],
        "MA" => ["country" => "Morocco", "continent" => "Africa"],
        "MZ" => ["country" => "Mozambique", "continent" => "Africa"],
        "MM" => ["country" => "Myanmar", "continent" => "Asia"],
        "NA" => ["country" => "Namibia", "continent" => "Africa"],
        "NR" => ["country" => "Nauru", "continent" => "Oceania"],
        "NP" => ["country" => "Nepal", "continent" => "Asia"],
        "NL" => ["country" => "Netherlands", "continent" => "Europe"],
        "AN" => ["country" => "Netherlands Antilles", "continent" => "North America"],
        "NC" => ["country" => "New Caledonia", "continent" => "Oceania"],
        "NZ" => ["country" => "New Zealand", "continent" => "Oceania"],
        "NI" => ["country" => "Nicaragua", "continent" => "North America"],
        "NE" => ["country" => "Niger", "continent" => "Africa"],
        "NG" => ["country" => "Nigeria", "continent" => "Africa"],
        "NU" => ["country" => "Niue", "continent" => "Oceania"],
        "NF" => ["country" => "Norfolk Island", "continent" => "Oceania"],
        "MP" => ["country" => "Northern Mariana Islands", "continent" => "Oceania"],
        "NO" => ["country" => "Norway", "continent" => "Europe"],
        "OM" => ["country" => "Oman", "continent" => "Asia"],
        "PK" => ["country" => "Pakistan", "continent" => "Asia"],
        "PW" => ["country" => "Palau", "continent" => "Oceania"],
        "PS" => ["country" => "Palestinia", "continent" => "Asia"],
        "PA" => ["country" => "Panama", "continent" => "North America"],
        "PG" => ["country" => "Papua New Guinea", "continent" => "Oceania"],
        "PY" => ["country" => "Paraguay", "continent" => "South America"],
        "PE" => ["country" => "Peru", "continent" => "South America"],
        "PH" => ["country" => "Philippines", "continent" => "Asia"],
        "PN" => ["country" => "Pitcairn", "continent" => "Oceania"],
        "PL" => ["country" => "Poland", "continent" => "Europe"],
        "PT" => ["country" => "Portugal", "continent" => "Europe"],
        "PR" => ["country" => "Puerto Rico", "continent" => "North America"],
        "QA" => ["country" => "Qatar", "continent" => "Asia"],
        "RE" => ["country" => "Reunion", "continent" => "Africa"],
        "RO" => ["country" => "Romania", "continent" => "Europe"],
        "RU" => ["country" => "Russian Federation", "continent" => "Europe"],
        "RW" => ["country" => "Rwanda", "continent" => "Africa"],
        "SH" => ["country" => "Saint Helena", "continent" => "Africa"],
        "KN" => ["country" => "Saint Kitts and Nevis", "continent" => "North America"],
        "LC" => ["country" => "Saint Lucia", "continent" => "North America"],
        "PM" => ["country" => "Saint Pierre and Miquelon", "continent" => "North America"],
        "VC" => ["country" => "Saint Vincent and The Grenadines", "continent" => "North America"],
        "WS" => ["country" => "Samoa", "continent" => "Oceania"],
        "SM" => ["country" => "San Marino", "continent" => "Europe"],
        "ST" => ["country" => "Sao Tome and Principe", "continent" => "Africa"],
        "SA" => ["country" => "Saudi Arabia", "continent" => "Asia"],
        "SN" => ["country" => "Senegal", "continent" => "Africa"],
        "RS" => ["country" => "Serbia", "continent" => "Europe"],
        "SC" => ["country" => "Seychelles", "continent" => "Africa"],
        "SL" => ["country" => "Sierra Leone", "continent" => "Africa"],
        "SG" => ["country" => "Singapore", "continent" => "Asia"],
        "SK" => ["country" => "Slovakia", "continent" => "Europe"],
        "SI" => ["country" => "Slovenia", "continent" => "Europe"],
        "SB" => ["country" => "Solomon Islands", "continent" => "Oceania"],
        "SO" => ["country" => "Somalia", "continent" => "Africa"],
        "ZA" => ["country" => "South Africa", "continent" => "Africa"],
        "GS" => ["country" => "South Georgia and The South Sandwich Islands", "continent" => "Antarctica"],
        "ES" => ["country" => "Spain", "continent" => "Europe"],
        "LK" => ["country" => "Sri Lanka", "continent" => "Asia"],
        "SD" => ["country" => "Sudan", "continent" => "Africa"],
        "SR" => ["country" => "Suriname", "continent" => "South America"],
        "SJ" => ["country" => "Svalbard and Jan Mayen", "continent" => "Europe"],
        "SZ" => ["country" => "Swaziland", "continent" => "Africa"],
        "SE" => ["country" => "Sweden", "continent" => "Europe"],
        "CH" => ["country" => "Switzerland", "continent" => "Europe"],
        "SY" => ["country" => "Syrian Arab Republic", "continent" => "Asia"],
        "TW" => ["country" => "Taiwan, Province of China", "continent" => "Asia"],
        "TJ" => ["country" => "Tajikistan", "continent" => "Asia"],
        "TZ" => ["country" => "Tanzania, United Republic of", "continent" => "Africa"],
        "TH" => ["country" => "Thailand", "continent" => "Asia"],
        "TL" => ["country" => "Timor-leste", "continent" => "Asia"],
        "TG" => ["country" => "Togo", "continent" => "Africa"],
        "TK" => ["country" => "Tokelau", "continent" => "Oceania"],
        "TO" => ["country" => "Tonga", "continent" => "Oceania"],
        "TT" => ["country" => "Trinidad and Tobago", "continent" => "North America"],
        "TN" => ["country" => "Tunisia", "continent" => "Africa"],
        "TR" => ["country" => "Turkey", "continent" => "Asia"],
        "TM" => ["country" => "Turkmenistan", "continent" => "Asia"],
        "TC" => ["country" => "Turks and Caicos Islands", "continent" => "North America"],
        "TV" => ["country" => "Tuvalu", "continent" => "Oceania"],
        "UG" => ["country" => "Uganda", "continent" => "Africa"],
        "UA" => ["country" => "Ukraine", "continent" => "Europe"],
        "AE" => ["country" => "United Arab Emirates", "continent" => "Asia"],
        "GB" => ["country" => "United Kingdom", "continent" => "Europe"],
        "US" => ["country" => "United States", "continent" => "North America"],
        "UM" => ["country" => "United States Minor Outlying Islands", "continent" => "Oceania"],
        "UY" => ["country" => "Uruguay", "continent" => "South America"],
        "UZ" => ["country" => "Uzbekistan", "continent" => "Asia"],
        "VU" => ["country" => "Vanuatu", "continent" => "Oceania"],
        "VE" => ["country" => "Venezuela", "continent" => "South America"],
        "VN" => ["country" => "Viet Nam", "continent" => "Asia"],
        "VG" => ["country" => "Virgin Islands, British", "continent" => "North America"],
        "VI" => ["country" => "Virgin Islands, U.S.", "continent" => "North America"],
        "WF" => ["country" => "Wallis and Futuna", "continent" => "Oceania"],
        "EH" => ["country" => "Western Sahara", "continent" => "Africa"],
        "YE" => ["country" => "Yemen", "continent" => "Asia"],
        "ZM" => ["country" => "Zambia", "continent" => "Africa"],
        "ZW" => ["country" => "Zimbabwe", "continent" => "Africa"]
    ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment