DaniWeb IT Discussion Community

Code Snippets (http://www.daniweb.com/code/)
-   php (http://www.daniweb.com/code/php.html)
-   -   Associative Array of States and Countries (http://www.daniweb.com/code/snippet402.html)

msteudel php syntax
Oct 17th, 2005
I was being really lazy and didn't want to write one up myself, couldn't find one, and ended writing one up myself anyways. Hope this helps other lazy people.

  1. array (
  2. 'AL' => 'Alabama',
  3. 'AK' => 'Alaska',
  4. 'AS' => 'American Samoa',
  5. 'AZ' => 'Arizona',
  6. 'AR' => 'Arkansas',
  7. 'AE' => 'Armed Forces - Europe',
  8. 'AP' => 'Armed Forces - Pacific',
  9. 'AA' => 'Armed Forces - USA/Canada',
  10. 'CA' => 'California',
  11. 'CO' => 'Colorado',
  12. 'CT' => 'Connecticut',
  13. 'DE' => 'Delaware',
  14. 'DC' => 'District of Columbia',
  15. 'FM' => 'Federated States of Micronesia',
  16. 'FL' => 'Florida',
  17. 'GA' => 'Georgia',
  18. 'GU' => 'Guam',
  19. 'HI' => 'Hawaii',
  20. 'ID' => 'Idaho',
  21. 'IL' => 'Illinois',
  22. 'IN' => 'Indiana',
  23. 'IA' => 'Iowa',
  24. 'KS' => 'Kansas',
  25. 'KY' => 'Kentucky',
  26. 'LA' => 'Louisiana',
  27. 'ME' => 'Maine',
  28. 'MH' => 'Marshall Islands',
  29. 'MD' => 'Maryland',
  30. 'MA' => 'Massachusetts',
  31. 'MI' => 'Michigan',
  32. 'MN' => 'Minnesota',
  33. 'MS' => 'Mississippi',
  34. 'MO' => 'Missouri',
  35. 'MT' => 'Montana',
  36. 'NE' => 'Nebraska',
  37. 'NV' => 'Nevada',
  38. 'NH' => 'New Hampshire',
  39. 'NJ' => 'New Jersey',
  40. 'NM' => 'New Mexico',
  41. 'NY' => 'New York',
  42. 'NC' => 'North Carolina',
  43. 'ND' => 'North Dakota',
  44. 'OH' => 'Ohio',
  45. 'OK' => 'Oklahoma',
  46. 'OR' => 'Oregon',
  47. 'PA' => 'Pennsylvania',
  48. 'PR' => 'Puerto Rico',
  49. 'RI' => 'Rhode Island',
  50. 'SC' => 'South Carolina',
  51. 'SD' => 'South Dakota',
  52. 'TN' => 'Tennessee',
  53. 'TX' => 'Texas',
  54. 'UT' => 'Utah',
  55. 'VT' => 'Vermont',
  56. 'VI' => 'Virgin Islands',
  57. 'VA' => 'Virginia',
  58. 'WA' => 'Washington',
  59. 'WV' => 'West Virginia',
  60. 'WI' => 'Wisconsin',
  61. 'WY' => 'Wyoming',
  62. 'AB' => 'Alberta',
  63. 'BC' => 'British Columbia',
  64. 'MB' => 'Manitoba',
  65. 'NB' => 'New Brunswick',
  66. 'NF' => 'Newfoundland',
  67. 'MP' => 'Northern Mariana Island ',
  68. 'NT' => 'Northwest Territories',
  69. 'NS' => 'Nova Scotia',
  70. 'ON' => 'Ontario',
  71. 'PW' => 'Palau Island',
  72. 'PE' => 'Prince Edward Island',
  73. 'QC' => 'Quebec',
  74. 'SK' => 'Saskatchewan',
  75. 'YT' => 'Yukon Territory',
  76. 'Australian Capital Territory' => 'Australian Capital Territory',
  77. 'New South Wales' => 'New South Wales',
  78. 'Northern Territory' => 'Northern Territory',
  79. 'Queensland' => 'Queensland',
  80. 'South Australia' => 'South Australia',
  81. 'Tasmania' => 'Tasmania',
  82. 'Victoria' => 'Victoria',
  83. 'Western Australia' => 'Western Australia');
  84. array( 'US' => 'United
  85. States',
  86. 'AF' => 'Afghanistan',
  87. 'AL' => 'Albania',
  88. 'DZ' => 'Algeria',
  89. 'AS' => 'American Samoa',
  90. 'AD' => 'Andorra',
  91. 'AO' => 'Angola',
  92. 'AI' => 'Anguilla',
  93. 'AQ' => 'Antarctica',
  94. 'AG' => 'Antigua And Barbuda',
  95. 'AR' => 'Argentina',
  96. 'AM' => 'Armenia',
  97. 'AW' => 'Aruba',
  98. 'AU' => 'Australia',
  99. 'AT' => 'Austria',
  100. 'AZ' => 'Azerbaijan',
  101. 'BS' => 'Bahamas',
  102. 'BH' => 'Bahrain',
  103. 'BD' => 'Bangladesh',
  104. 'BB' => 'Barbados',
  105. 'BY' => 'Belarus',
  106. 'BE' => 'Belgium',
  107. 'BZ' => 'Belize',
  108. 'BJ' => 'Benin',
  109. 'BM' => 'Bermuda',
  110. 'BT' => 'Bhutan',
  111. 'BO' => 'Bolivia',
  112. 'BA' => 'Bosnia And Herzegowina',
  113. 'BW' => 'Botswana',
  114. 'BV' => 'Bouvet Island',
  115. 'BR' => 'Brazil',
  116. 'IO' => 'British Indian Ocean Territory',
  117. 'BN' => 'Brunei Darussalam',
  118. 'BG' => 'Bulgaria',
  119. 'BF' => 'Burkina Faso',
  120. 'BI' => 'Burundi',
  121. 'KH' => 'Cambodia',
  122. 'CM' => 'Cameroon',
  123. 'CA' => 'Canada',
  124. 'CV' => 'Cape Verde',
  125. 'KY' => 'Cayman Islands',
  126. 'CF' => 'Central African Republic',
  127. 'TD' => 'Chad',
  128. 'CL' => 'Chile',
  129. 'CN' => 'China',
  130. 'CX' => 'Christmas Island',
  131. 'CC' => 'Cocos (Keeling) Islands',
  132. 'CO' => 'Colombia',
  133. 'KM' => 'Comoros',
  134. 'CG' => 'Congo',
  135. 'CD' => 'Congo, The Democratic Republic Of The',
  136. 'CK' => 'Cook Islands',
  137. 'CR' => 'Costa Rica',
  138. 'CI' => 'Cote D\'Ivoire',
  139. 'HR' => 'Croatia (Local Name: Hrvatska)',
  140. 'CU' => 'Cuba',
  141. 'CY' => 'Cyprus',
  142. 'CZ' => 'Czech Republic',
  143. 'DK' => 'Denmark',
  144. 'DJ' => 'Djibouti',
  145. 'DM' => 'Dominica',
  146. 'DO' => 'Dominican Republic',
  147. 'TP' => 'East Timor',
  148. 'EC' => 'Ecuador',
  149. 'EG' => 'Egypt',
  150. 'SV' => 'El Salvador',
  151. 'GQ' => 'Equatorial Guinea',
  152. 'ER' => 'Eritrea',
  153. 'EE' => 'Estonia',
  154. 'ET' => 'Ethiopia',
  155. 'FK' => 'Falkland Islands (Malvinas)',
  156. 'FO' => 'Faroe Islands',
  157. 'FJ' => 'Fiji',
  158. 'FI' => 'Finland',
  159. 'FR' => 'France',
  160. 'FX' => 'France, Metropolitan',
  161. 'GF' => 'French Guiana',
  162. 'PF' => 'French Polynesia',
  163. 'TF' => 'French Southern Territories',
  164. 'GA' => 'Gabon',
  165. 'GM' => 'Gambia',
  166. 'GE' => 'Georgia',
  167. 'DE' => 'Germany',
  168. 'GH' => 'Ghana',
  169. 'GI' => 'Gibraltar',
  170. 'GR' => 'Greece',
  171. 'GL' => 'Greenland',
  172. 'GD' => 'Grenada',
  173. 'GP' => 'Guadeloupe',
  174. 'GU' => 'Guam',
  175. 'GT' => 'Guatemala',
  176. 'GN' => 'Guinea',
  177. 'GW' => 'Guinea-Bissau',
  178. 'GY' => 'Guyana',
  179. 'HT' => 'Haiti',
  180. 'HM' => 'Heard And Mc Donald Islands',
  181. 'VA' => 'Holy See (Vatican City State)',
  182. 'HN' => 'Honduras',
  183. 'HK' => 'Hong Kong',
  184. 'HU' => 'Hungary',
  185. 'IS' => 'Iceland',
  186. 'IN' => 'India',
  187. 'ID' => 'Indonesia',
  188. 'IR' => 'Iran (Islamic Republic Of)',
  189. 'IQ' => 'Iraq',
  190. 'IE' => 'Ireland',
  191. 'IL' => 'Israel',
  192. 'IT' => 'Italy',
  193. 'JM' => 'Jamaica',
  194. 'JP' => 'Japan',
  195. 'JO' => 'Jordan',
  196. 'KZ' => 'Kazakhstan',
  197. 'KE' => 'Kenya',
  198. 'KI' => 'Kiribati',
  199. 'KP' => 'Korea, Democratic People\'S Republic Of',
  200. 'KR' => 'Korea, Republic Of',
  201. 'KW' => 'Kuwait',
  202. 'KG' => 'Kyrgyzstan',
  203. 'LA' => 'Lao People\'S Democratic Republic',
  204. 'LV' => 'Latvia',
  205. 'LB' => 'Lebanon',
  206. 'LS' => 'Lesotho',
  207. 'LR' => 'Liberia',
  208. 'LY' => 'Libyan Arab Jamahiriya',
  209. 'LI' => 'Liechtenstein',
  210. 'LT' => 'Lithuania',
  211. 'LU' => 'Luxembourg',
  212. 'MO' => 'Macau',
  213. 'MK' => 'Macedonia, Former Yugoslav Republic Of',
  214. 'MG' => 'Madagascar',
  215. 'MW' => 'Malawi',
  216. 'MY' => 'Malaysia',
  217. 'MV' => 'Maldives',
  218. 'ML' => 'Mali',
  219. 'MT' => 'Malta',
  220. 'MH' => 'Marshall Islands',
  221. 'MQ' => 'Martinique',
  222. 'MR' => 'Mauritania',
  223. 'MU' => 'Mauritius',
  224. 'YT' => 'Mayotte',
  225. 'MX' => 'Mexico',
  226. 'FM' => 'Micronesia, Federated States Of',
  227. 'MD' => 'Moldova, Republic Of',
  228. 'MC' => 'Monaco',
  229. 'MN' => 'Mongolia',
  230. 'MS' => 'Montserrat',
  231. 'MA' => 'Morocco',
  232. 'MZ' => 'Mozambique',
  233. 'MM' => 'Myanmar',
  234. 'NA' => 'Namibia',
  235. 'NR' => 'Nauru',
  236. 'NP' => 'Nepal',
  237. 'NL' => 'Netherlands',
  238. 'AN' => 'Netherlands Antilles',
  239. 'NC' => 'New Caledonia',
  240. 'NZ' => 'New Zealand',
  241. 'NI' => 'Nicaragua',
  242. 'NE' => 'Niger',
  243. 'NG' => 'Nigeria',
  244. 'NU' => 'Niue',
  245. 'NF' => 'Norfolk Island',
  246. 'MP' => 'Northern Mariana Islands',
  247. 'NO' => 'Norway',
  248. 'OM' => 'Oman',
  249. 'PK' => 'Pakistan',
  250. 'PW' => 'Palau',
  251. 'PA' => 'Panama',
  252. 'PG' => 'Papua New Guinea',
  253. 'PY' => 'Paraguay',
  254. 'PE' => 'Peru',
  255. 'PH' => 'Philippines',
  256. 'PN' => 'Pitcairn',
  257. 'PL' => 'Poland',
  258. 'PT' => 'Portugal',
  259. 'PR' => 'Puerto Rico',
  260. 'QA' => 'Qatar',
  261. 'RE' => 'Reunion',
  262. 'RO' => 'Romania',
  263. 'RU' => 'Russian Federation',
  264. 'RW' => 'Rwanda',
  265. 'KN' => 'Saint Kitts And Nevis',
  266. 'LC' => 'Saint Lucia',
  267. 'VC' => 'Saint Vincent And The Grenadines',
  268. 'WS' => 'Samoa',
  269. 'SM' => 'San Marino',
  270. 'ST' => 'Sao Tome And Principe',
  271. 'SA' => 'Saudi Arabia',
  272. 'SN' => 'Senegal',
  273. 'SC' => 'Seychelles',
  274. 'SL' => 'Sierra Leone',
  275. 'SG' => 'Singapore',
  276. 'SK' => 'Slovakia (Slovak Republic)',
  277. 'SI' => 'Slovenia',
  278. 'SB' => 'Solomon Islands',
  279. 'SO' => 'Somalia',
  280. 'ZA' => 'South Africa',
  281. 'GS' => 'South Georgia, South Sandwich Islands',
  282. 'ES' => 'Spain',
  283. 'LK' => 'Sri Lanka',
  284. 'SH' => 'St. Helena',
  285. 'PM' => 'St. Pierre And Miquelon',
  286. 'SD' => 'Sudan',
  287. 'SR' => 'Suriname',
  288. 'SJ' => 'Svalbard And Jan Mayen Islands',
  289. 'SZ' => 'Swaziland',
  290. 'SE' => 'Sweden',
  291. 'CH' => 'Switzerland',
  292. 'SY' => 'Syrian Arab Republic',
  293. 'TW' => 'Taiwan',
  294. 'TJ' => 'Tajikistan',
  295. 'TZ' => 'Tanzania, United Republic Of',
  296. 'TH' => 'Thailand',
  297. 'TG' => 'Togo',
  298. 'TK' => 'Tokelau',
  299. 'TO' => 'Tonga',
  300. 'TT' => 'Trinidad And Tobago',
  301. 'TN' => 'Tunisia',
  302. 'TR' => 'Turkey',
  303. 'TM' => 'Turkmenistan',
  304. 'TC' => 'Turks And Caicos Islands',
  305. 'TV' => 'Tuvalu',
  306. 'UG' => 'Uganda',
  307. 'UA' => 'Ukraine',
  308. 'AE' => 'United Arab Emirates',
  309. 'GB' => 'United Kingdom',
  310. 'UM' => 'United States Minor Outlying Islands',
  311. 'UY' => 'Uruguay',
  312. 'UZ' => 'Uzbekistan',
  313. 'VU' => 'Vanuatu',
  314. 'VE' => 'Venezuela',
  315. 'VN' => 'Viet Nam',
  316. 'VG' => 'Virgin Islands (British)',
  317. 'VI' => 'Virgin Islands (U.S.)',
  318. 'WF' => 'Wallis And Futuna Islands',
  319. 'EH' => 'Western Sahara',
  320. 'YE' => 'Yemen',
  321. 'YU' => 'Yugoslavia',
  322. 'ZM' => 'Zambia',
  323. 'ZW' => 'Zimbabwe' );