PHP Array Of Countries

3rd February 2011 - 12 minutes read time

Use the following array if you want to get a list of countries, along with their codes. These codes are the 2 letter ISO code, the 3 letter UN code and the 3 number UN code. I had to build this the other day in order to present a list of countries in a form so I post it here in case I need something like it again.

  1. $countries = array(
  2. "AF" => array("AFGHANISTAN", "AF", "AFG", "004"),
  3. "AL" => array("ALBANIA", "AL", "ALB", "008"),
  4. "DZ" => array("ALGERIA", "DZ", "DZA", "012"),
  5. "AS" => array("AMERICAN SAMOA", "AS", "ASM", "016"),
  6. "AD" => array("ANDORRA", "AD", "AND", "020"),
  7. "AO" => array("ANGOLA", "AO", "AGO", "024"),
  8. "AI" => array("ANGUILLA", "AI", "AIA", "660"),
  9. "AQ" => array("ANTARCTICA", "AQ", "ATA", "010"),
  10. "AG" => array("ANTIGUA AND BARBUDA", "AG", "ATG", "028"),
  11. "AR" => array("ARGENTINA", "AR", "ARG", "032"),
  12. "AM" => array("ARMENIA", "AM", "ARM", "051"),
  13. "AW" => array("ARUBA", "AW", "ABW", "533"),
  14. "AU" => array("AUSTRALIA", "AU", "AUS", "036"),
  15. "AT" => array("AUSTRIA", "AT", "AUT", "040"),
  16. "AZ" => array("AZERBAIJAN", "AZ", "AZE", "031"),
  17. "BS" => array("BAHAMAS", "BS", "BHS", "044"),
  18. "BH" => array("BAHRAIN", "BH", "BHR", "048"),
  19. "BD" => array("BANGLADESH", "BD", "BGD", "050"),
  20. "BB" => array("BARBADOS", "BB", "BRB", "052"),
  21. "BY" => array("BELARUS", "BY", "BLR", "112"),
  22. "BE" => array("BELGIUM", "BE", "BEL", "056"),
  23. "BZ" => array("BELIZE", "BZ", "BLZ", "084"),
  24. "BJ" => array("BENIN", "BJ", "BEN", "204"),
  25. "BM" => array("BERMUDA", "BM", "BMU", "060"),
  26. "BT" => array("BHUTAN", "BT", "BTN", "064"),
  27. "BO" => array("BOLIVIA", "BO", "BOL", "068"),
  28. "BA" => array("BOSNIA AND HERZEGOVINA", "BA", "BIH", "070"),
  29. "BW" => array("BOTSWANA", "BW", "BWA", "072"),
  30. "BV" => array("BOUVET ISLAND", "BV", "BVT", "074"),
  31. "BR" => array("BRAZIL", "BR", "BRA", "076"),
  32. "IO" => array("BRITISH INDIAN OCEAN TERRITORY", "IO", "IOT", "086"),
  33. "BN" => array("BRUNEI DARUSSALAM", "BN", "BRN", "096"),
  34. "BG" => array("BULGARIA", "BG", "BGR", "100"),
  35. "BF" => array("BURKINA FASO", "BF", "BFA", "854"),
  36. "BI" => array("BURUNDI", "BI", "BDI", "108"),
  37. "KH" => array("CAMBODIA", "KH", "KHM", "116"),
  38. "CM" => array("CAMEROON", "CM", "CMR", "120"),
  39. "CA" => array("CANADA", "CA", "CAN", "124"),
  40. "CV" => array("CAPE VERDE", "CV", "CPV", "132"),
  41. "KY" => array("CAYMAN ISLANDS", "KY", "CYM", "136"),
  42. "CF" => array("CENTRAL AFRICAN REPUBLIC", "CF", "CAF", "140"),
  43. "TD" => array("CHAD", "TD", "TCD", "148"),
  44. "CL" => array("CHILE", "CL", "CHL", "152"),
  45. "CN" => array("CHINA", "CN", "CHN", "156"),
  46. "CX" => array("CHRISTMAS ISLAND", "CX", "CXR", "162"),
  47. "CC" => array("COCOS (KEELING) ISLANDS", "CC", "CCK", "166"),
  48. "CO" => array("COLOMBIA", "CO", "COL", "170"),
  49. "KM" => array("COMOROS", "KM", "COM", "174"),
  50. "CG" => array("CONGO", "CG", "COG", "178"),
  51. "CK" => array("COOK ISLANDS", "CK", "COK", "184"),
  52. "CR" => array("COSTA RICA", "CR", "CRI", "188"),
  53. "CI" => array("COTE D'IVOIRE", "CI", "CIV", "384"),
  54. "HR" => array("CROATIA (local name: Hrvatska)", "HR", "HRV", "191"),
  55. "CU" => array("CUBA", "CU", "CUB", "192"),
  56. "CY" => array("CYPRUS", "CY", "CYP", "196"),
  57. "CZ" => array("CZECH REPUBLIC", "CZ", "CZE", "203"),
  58. "DK" => array("DENMARK", "DK", "DNK", "208"),
  59. "DJ" => array("DJIBOUTI", "DJ", "DJI", "262"),
  60. "DM" => array("DOMINICA", "DM", "DMA", "212"),
  61. "DO" => array("DOMINICAN REPUBLIC", "DO", "DOM", "214"),
  62. "TL" => array("EAST TIMOR", "TL", "TLS", "626"),
  63. "EC" => array("ECUADOR", "EC", "ECU", "218"),
  64. "EG" => array("EGYPT", "EG", "EGY", "818"),
  65. "SV" => array("EL SALVADOR", "SV", "SLV", "222"),
  66. "GQ" => array("EQUATORIAL GUINEA", "GQ", "GNQ", "226"),
  67. "ER" => array("ERITREA", "ER", "ERI", "232"),
  68. "EE" => array("ESTONIA", "EE", "EST", "233"),
  69. "ET" => array("ETHIOPIA", "ET", "ETH", "210"),
  70. "FK" => array("FALKLAND ISLANDS (MALVINAS)", "FK", "FLK", "238"),
  71. "FO" => array("FAROE ISLANDS", "FO", "FRO", "234"),
  72. "FJ" => array("FIJI", "FJ", "FJI", "242"),
  73. "FI" => array("FINLAND", "FI", "FIN", "246"),
  74. "FR" => array("FRANCE", "FR", "FRA", "250"),
  75. "FX" => array("FRANCE, METROPOLITAN", "FX", "FXX", "249"),
  76. "GF" => array("FRENCH GUIANA", "GF", "GUF", "254"),
  77. "PF" => array("FRENCH POLYNESIA", "PF", "PYF", "258"),
  78. "TF" => array("FRENCH SOUTHERN TERRITORIES", "TF", "ATF", "260"),
  79. "GA" => array("GABON", "GA", "GAB", "266"),
  80. "GM" => array("GAMBIA", "GM", "GMB", "270"),
  81. "GE" => array("GEORGIA", "GE", "GEO", "268"),
  82. "DE" => array("GERMANY", "DE", "DEU", "276"),
  83. "GH" => array("GHANA", "GH", "GHA", "288"),
  84. "GI" => array("GIBRALTAR", "GI", "GIB", "292"),
  85. "GR" => array("GREECE", "GR", "GRC", "300"),
  86. "GL" => array("GREENLAND", "GL", "GRL", "304"),
  87. "GD" => array("GRENADA", "GD", "GRD", "308"),
  88. "GP" => array("GUADELOUPE", "GP", "GLP", "312"),
  89. "GU" => array("GUAM", "GU", "GUM", "316"),
  90. "GT" => array("GUATEMALA", "GT", "GTM", "320"),
  91. "GN" => array("GUINEA", "GN", "GIN", "324"),
  92. "GW" => array("GUINEA-BISSAU", "GW", "GNB", "624"),
  93. "GY" => array("GUYANA", "GY", "GUY", "328"),
  94. "HT" => array("HAITI", "HT", "HTI", "332"),
  95. "HM" => array("HEARD ISLAND & MCDONALD ISLANDS", "HM", "HMD", "334"),
  96. "HN" => array("HONDURAS", "HN", "HND", "340"),
  97. "HK" => array("HONG KONG", "HK", "HKG", "344"),
  98. "HU" => array("HUNGARY", "HU", "HUN", "348"),
  99. "IS" => array("ICELAND", "IS", "ISL", "352"),
  100. "IN" => array("INDIA", "IN", "IND", "356"),
  101. "ID" => array("INDONESIA", "ID", "IDN", "360"),
  102. "IR" => array("IRAN, ISLAMIC REPUBLIC OF", "IR", "IRN", "364"),
  103. "IQ" => array("IRAQ", "IQ", "IRQ", "368"),
  104. "IE" => array("IRELAND", "IE", "IRL", "372"),
  105. "IL" => array("ISRAEL", "IL", "ISR", "376"),
  106. "IT" => array("ITALY", "IT", "ITA", "380"),
  107. "JM" => array("JAMAICA", "JM", "JAM", "388"),
  108. "JP" => array("JAPAN", "JP", "JPN", "392"),
  109. "JO" => array("JORDAN", "JO", "JOR", "400"),
  110. "KZ" => array("KAZAKHSTAN", "KZ", "KAZ", "398"),
  111. "KE" => array("KENYA", "KE", "KEN", "404"),
  112. "KI" => array("KIRIBATI", "KI", "KIR", "296"),
  113. "KP" => array("KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", "KP", "PRK", "408"),
  114. "KR" => array("KOREA, REPUBLIC OF", "KR", "KOR", "410"),
  115. "KW" => array("KUWAIT", "KW", "KWT", "414"),
  116. "KG" => array("KYRGYZSTAN", "KG", "KGZ", "417"),
  117. "LA" => array("LAO PEOPLE'S DEMOCRATIC REPUBLIC", "LA", "LAO", "418"),
  118. "LV" => array("LATVIA", "LV", "LVA", "428"),
  119. "LB" => array("LEBANON", "LB", "LBN", "422"),
  120. "LS" => array("LESOTHO", "LS", "LSO", "426"),
  121. "LR" => array("LIBERIA", "LR", "LBR", "430"),
  122. "LY" => array("LIBYAN ARAB JAMAHIRIYA", "LY", "LBY", "434"),
  123. "LI" => array("LIECHTENSTEIN", "LI", "LIE", "438"),
  124. "LT" => array("LITHUANIA", "LT", "LTU", "440"),
  125. "LU" => array("LUXEMBOURG", "LU", "LUX", "442"),
  126. "MO" => array("MACAU", "MO", "MAC", "446"),
  127. "MK" => array("MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", "MK", "MKD", "807"),
  128. "MG" => array("MADAGASCAR", "MG", "MDG", "450"),
  129. "MW" => array("MALAWI", "MW", "MWI", "454"),
  130. "MY" => array("MALAYSIA", "MY", "MYS", "458"),
  131. "MV" => array("MALDIVES", "MV", "MDV", "462"),
  132. "ML" => array("MALI", "ML", "MLI", "466"),
  133. "MT" => array("MALTA", "MT", "MLT", "470"),
  134. "MH" => array("MARSHALL ISLANDS", "MH", "MHL", "584"),
  135. "MQ" => array("MARTINIQUE", "MQ", "MTQ", "474"),
  136. "MR" => array("MAURITANIA", "MR", "MRT", "478"),
  137. "MU" => array("MAURITIUS", "MU", "MUS", "480"),
  138. "YT" => array("MAYOTTE", "YT", "MYT", "175"),
  139. "MX" => array("MEXICO", "MX", "MEX", "484"),
  140. "FM" => array("MICRONESIA, FEDERATED STATES OF", "FM", "FSM", "583"),
  141. "MD" => array("MOLDOVA, REPUBLIC OF", "MD", "MDA", "498"),
  142. "MC" => array("MONACO", "MC", "MCO", "492"),
  143. "MN" => array("MONGOLIA", "MN", "MNG", "496"),
  144. "MS" => array("MONTSERRAT", "MS", "MSR", "500"),
  145. "MA" => array("MOROCCO", "MA", "MAR", "504"),
  146. "MZ" => array("MOZAMBIQUE", "MZ", "MOZ", "508"),
  147. "MM" => array("MYANMAR", "MM", "MMR", "104"),
  148. "NA" => array("NAMIBIA", "NA", "NAM", "516"),
  149. "NR" => array("NAURU", "NR", "NRU", "520"),
  150. "NP" => array("NEPAL", "NP", "NPL", "524"),
  151. "NL" => array("NETHERLANDS", "NL", "NLD", "528"),
  152. "AN" => array("NETHERLANDS ANTILLES", "AN", "ANT", "530"),
  153. "NC" => array("NEW CALEDONIA", "NC", "NCL", "540"),
  154. "NZ" => array("NEW ZEALAND", "NZ", "NZL", "554"),
  155. "NI" => array("NICARAGUA", "NI", "NIC", "558"),
  156. "NE" => array("NIGER", "NE", "NER", "562"),
  157. "NG" => array("NIGERIA", "NG", "NGA", "566"),
  158. "NU" => array("NIUE", "NU", "NIU", "570"),
  159. "NF" => array("NORFOLK ISLAND", "NF", "NFK", "574"),
  160. "MP" => array("NORTHERN MARIANA ISLANDS", "MP", "MNP", "580"),
  161. "NO" => array("NORWAY", "NO", "NOR", "578"),
  162. "OM" => array("OMAN", "OM", "OMN", "512"),
  163. "PK" => array("PAKISTAN", "PK", "PAK", "586"),
  164. "PW" => array("PALAU", "PW", "PLW", "585"),
  165. "PA" => array("PANAMA", "PA", "PAN", "591"),
  166. "PG" => array("PAPUA NEW GUINEA", "PG", "PNG", "598"),
  167. "PY" => array("PARAGUAY", "PY", "PRY", "600"),
  168. "PE" => array("PERU", "PE", "PER", "604"),
  169. "PH" => array("PHILIPPINES", "PH", "PHL", "608"),
  170. "PN" => array("PITCAIRN", "PN", "PCN", "612"),
  171. "PL" => array("POLAND", "PL", "POL", "616"),
  172. "PT" => array("PORTUGAL", "PT", "PRT", "620"),
  173. "PR" => array("PUERTO RICO", "PR", "PRI", "630"),
  174. "QA" => array("QATAR", "QA", "QAT", "634"),
  175. "RE" => array("REUNION", "RE", "REU", "638"),
  176. "RO" => array("ROMANIA", "RO", "ROU", "642"),
  177. "RU" => array("RUSSIAN FEDERATION", "RU", "RUS", "643"),
  178. "RW" => array("RWANDA", "RW", "RWA", "646"),
  179. "KN" => array("SAINT KITTS AND NEVIS", "KN", "KNA", "659"),
  180. "LC" => array("SAINT LUCIA", "LC", "LCA", "662"),
  181. "VC" => array("SAINT VINCENT AND THE GRENADINES", "VC", "VCT", "670"),
  182. "WS" => array("SAMOA", "WS", "WSM", "882"),
  183. "SM" => array("SAN MARINO", "SM", "SMR", "674"),
  184. "ST" => array("SAO TOME AND PRINCIPE", "ST", "STP", "678"),
  185. "SA" => array("SAUDI ARABIA", "SA", "SAU", "682"),
  186. "SN" => array("SENEGAL", "SN", "SEN", "686"),
  187. "RS" => array("SERBIA", "RS", "SRB", "688"),
  188. "SC" => array("SEYCHELLES", "SC", "SYC", "690"),
  189. "SL" => array("SIERRA LEONE", "SL", "SLE", "694"),
  190. "SG" => array("SINGAPORE", "SG", "SGP", "702"),
  191. "SK" => array("SLOVAKIA (Slovak Republic)", "SK", "SVK", "703"),
  192. "SI" => array("SLOVENIA", "SI", "SVN", "705"),
  193. "SB" => array("SOLOMON ISLANDS", "SB", "SLB", "90"),
  194. "SO" => array("SOMALIA", "SO", "SOM", "706"),
  195. "ZA" => array("SOUTH AFRICA", "ZA", "ZAF", "710"),
  196. "ES" => array("SPAIN", "ES", "ESP", "724"),
  197. "LK" => array("SRI LANKA", "LK", "LKA", "144"),
  198. "SH" => array("SAINT HELENA", "SH", "SHN", "654"),
  199. "PM" => array("SAINT PIERRE AND MIQUELON", "PM", "SPM", "666"),
  200. "SD" => array("SUDAN", "SD", "SDN", "736"),
  201. "SR" => array("SURINAME", "SR", "SUR", "740"),
  202. "SJ" => array("SVALBARD AND JAN MAYEN ISLANDS", "SJ", "SJM", "744"),
  203. "SZ" => array("SWAZILAND", "SZ", "SWZ", "748"),
  204. "SE" => array("SWEDEN", "SE", "SWE", "752"),
  205. "CH" => array("SWITZERLAND", "CH", "CHE", "756"),
  206. "SY" => array("SYRIAN ARAB REPUBLIC", "SY", "SYR", "760"),
  207. "TW" => array("TAIWAN, PROVINCE OF CHINA", "TW", "TWN", "158"),
  208. "TJ" => array("TAJIKISTAN", "TJ", "TJK", "762"),
  209. "TZ" => array("TANZANIA, UNITED REPUBLIC OF", "TZ", "TZA", "834"),
  210. "TH" => array("THAILAND", "TH", "THA", "764"),
  211. "TG" => array("TOGO", "TG", "TGO", "768"),
  212. "TK" => array("TOKELAU", "TK", "TKL", "772"),
  213. "TO" => array("TONGA", "TO", "TON", "776"),
  214. "TT" => array("TRINIDAD AND TOBAGO", "TT", "TTO", "780"),
  215. "TN" => array("TUNISIA", "TN", "TUN", "788"),
  216. "TR" => array("TURKEY", "TR", "TUR", "792"),
  217. "TM" => array("TURKMENISTAN", "TM", "TKM", "795"),
  218. "TC" => array("TURKS AND CAICOS ISLANDS", "TC", "TCA", "796"),
  219. "TV" => array("TUVALU", "TV", "TUV", "798"),
  220. "UG" => array("UGANDA", "UG", "UGA", "800"),
  221. "UA" => array("UKRAINE", "UA", "UKR", "804"),
  222. "AE" => array("UNITED ARAB EMIRATES", "AE", "ARE", "784"),
  223. "GB" => array("UNITED KINGDOM", "GB", "GBR", "826"),
  224. "US" => array("UNITED STATES", "US", "USA", "840"),
  225. "UM" => array("UNITED STATES MINOR OUTLYING ISLANDS", "UM", "UMI", "581"),
  226. "UY" => array("URUGUAY", "UY", "URY", "858"),
  227. "UZ" => array("UZBEKISTAN", "UZ", "UZB", "860"),
  228. "VU" => array("VANUATU", "VU", "VUT", "548"),
  229. "VA" => array("VATICAN CITY STATE (HOLY SEE)", "VA", "VAT", "336"),
  230. "VE" => array("VENEZUELA", "VE", "VEN", "862"),
  231. "VN" => array("VIET NAM", "VN", "VNM", "704"),
  232. "VG" => array("VIRGIN ISLANDS (BRITISH)", "VG", "VGB", "92"),
  233. "VI" => array("VIRGIN ISLANDS (U.S.)", "VI", "VIR", "850"),
  234. "WF" => array("WALLIS AND FUTUNA ISLANDS", "WF", "WLF", "876"),
  235. "EH" => array("WESTERN SAHARA", "EH", "ESH", "732"),
  236. "YE" => array("YEMEN", "YE", "YEM", "887"),
  237. "YU" => array("YUGOSLAVIA", "YU", "YUG", "891"),
  238. "ZR" => array("ZAIRE", "ZR", "ZAR", "180"),
  239. "ZM" => array("ZAMBIA", "ZM", "ZMB", "894"),
  240. "ZW" => array("ZIMBABWE", "ZW", "ZWE", "716"),
  241. );

Obviously this list is subject to change but the main bulk of it should stay the same. If you notice any changes then please let me know and I'll update it.

Comments

Permalink
Ivory Coast is missing, see below: 'CI' => array('IVORY COAST', 'CI', 'CIV', '225'),

iCalculator (Fri, 05/19/2017 - 10:01)

Add new comment

The content of this field is kept private and will not be shown publicly.