Posted By

gilbitron on 07/08/10


Tagged

php list html country


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

convergine
guillermoj88gmailcom


PHP Country Code to Country Name List


 / Published in: PHP
 

  1. function country_code_to_country( $code ){
  2. $country = '';
  3. if( $code == 'AF' ) $country = 'Afghanistan';
  4. if( $code == 'AX' ) $country = 'Aland Islands';
  5. if( $code == 'AL' ) $country = 'Albania';
  6. if( $code == 'DZ' ) $country = 'Algeria';
  7. if( $code == 'AS' ) $country = 'American Samoa';
  8. if( $code == 'AD' ) $country = 'Andorra';
  9. if( $code == 'AO' ) $country = 'Angola';
  10. if( $code == 'AI' ) $country = 'Anguilla';
  11. if( $code == 'AQ' ) $country = 'Antarctica';
  12. if( $code == 'AG' ) $country = 'Antigua and Barbuda';
  13. if( $code == 'AR' ) $country = 'Argentina';
  14. if( $code == 'AM' ) $country = 'Armenia';
  15. if( $code == 'AW' ) $country = 'Aruba';
  16. if( $code == 'AU' ) $country = 'Australia';
  17. if( $code == 'AT' ) $country = 'Austria';
  18. if( $code == 'AZ' ) $country = 'Azerbaijan';
  19. if( $code == 'BS' ) $country = 'Bahamas the';
  20. if( $code == 'BH' ) $country = 'Bahrain';
  21. if( $code == 'BD' ) $country = 'Bangladesh';
  22. if( $code == 'BB' ) $country = 'Barbados';
  23. if( $code == 'BY' ) $country = 'Belarus';
  24. if( $code == 'BE' ) $country = 'Belgium';
  25. if( $code == 'BZ' ) $country = 'Belize';
  26. if( $code == 'BJ' ) $country = 'Benin';
  27. if( $code == 'BM' ) $country = 'Bermuda';
  28. if( $code == 'BT' ) $country = 'Bhutan';
  29. if( $code == 'BO' ) $country = 'Bolivia';
  30. if( $code == 'BA' ) $country = 'Bosnia and Herzegovina';
  31. if( $code == 'BW' ) $country = 'Botswana';
  32. if( $code == 'BV' ) $country = 'Bouvet Island (Bouvetoya)';
  33. if( $code == 'BR' ) $country = 'Brazil';
  34. if( $code == 'IO' ) $country = 'British Indian Ocean Territory (Chagos Archipelago)';
  35. if( $code == 'VG' ) $country = 'British Virgin Islands';
  36. if( $code == 'BN' ) $country = 'Brunei Darussalam';
  37. if( $code == 'BG' ) $country = 'Bulgaria';
  38. if( $code == 'BF' ) $country = 'Burkina Faso';
  39. if( $code == 'BI' ) $country = 'Burundi';
  40. if( $code == 'KH' ) $country = 'Cambodia';
  41. if( $code == 'CM' ) $country = 'Cameroon';
  42. if( $code == 'CA' ) $country = 'Canada';
  43. if( $code == 'CV' ) $country = 'Cape Verde';
  44. if( $code == 'KY' ) $country = 'Cayman Islands';
  45. if( $code == 'CF' ) $country = 'Central African Republic';
  46. if( $code == 'TD' ) $country = 'Chad';
  47. if( $code == 'CL' ) $country = 'Chile';
  48. if( $code == 'CN' ) $country = 'China';
  49. if( $code == 'CX' ) $country = 'Christmas Island';
  50. if( $code == 'CC' ) $country = 'Cocos (Keeling) Islands';
  51. if( $code == 'CO' ) $country = 'Colombia';
  52. if( $code == 'KM' ) $country = 'Comoros the';
  53. if( $code == 'CD' ) $country = 'Congo';
  54. if( $code == 'CG' ) $country = 'Congo the';
  55. if( $code == 'CK' ) $country = 'Cook Islands';
  56. if( $code == 'CR' ) $country = 'Costa Rica';
  57. if( $code == 'CI' ) $country = 'Cote d\'Ivoire';
  58. if( $code == 'HR' ) $country = 'Croatia';
  59. if( $code == 'CU' ) $country = 'Cuba';
  60. if( $code == 'CY' ) $country = 'Cyprus';
  61. if( $code == 'CZ' ) $country = 'Czech Republic';
  62. if( $code == 'DK' ) $country = 'Denmark';
  63. if( $code == 'DJ' ) $country = 'Djibouti';
  64. if( $code == 'DM' ) $country = 'Dominica';
  65. if( $code == 'DO' ) $country = 'Dominican Republic';
  66. if( $code == 'EC' ) $country = 'Ecuador';
  67. if( $code == 'EG' ) $country = 'Egypt';
  68. if( $code == 'SV' ) $country = 'El Salvador';
  69. if( $code == 'GQ' ) $country = 'Equatorial Guinea';
  70. if( $code == 'ER' ) $country = 'Eritrea';
  71. if( $code == 'EE' ) $country = 'Estonia';
  72. if( $code == 'ET' ) $country = 'Ethiopia';
  73. if( $code == 'FO' ) $country = 'Faroe Islands';
  74. if( $code == 'FK' ) $country = 'Falkland Islands (Malvinas)';
  75. if( $code == 'FJ' ) $country = 'Fiji the Fiji Islands';
  76. if( $code == 'FI' ) $country = 'Finland';
  77. if( $code == 'FR' ) $country = 'France, French Republic';
  78. if( $code == 'GF' ) $country = 'French Guiana';
  79. if( $code == 'PF' ) $country = 'French Polynesia';
  80. if( $code == 'TF' ) $country = 'French Southern Territories';
  81. if( $code == 'GA' ) $country = 'Gabon';
  82. if( $code == 'GM' ) $country = 'Gambia the';
  83. if( $code == 'GE' ) $country = 'Georgia';
  84. if( $code == 'DE' ) $country = 'Germany';
  85. if( $code == 'GH' ) $country = 'Ghana';
  86. if( $code == 'GI' ) $country = 'Gibraltar';
  87. if( $code == 'GR' ) $country = 'Greece';
  88. if( $code == 'GL' ) $country = 'Greenland';
  89. if( $code == 'GD' ) $country = 'Grenada';
  90. if( $code == 'GP' ) $country = 'Guadeloupe';
  91. if( $code == 'GU' ) $country = 'Guam';
  92. if( $code == 'GT' ) $country = 'Guatemala';
  93. if( $code == 'GG' ) $country = 'Guernsey';
  94. if( $code == 'GN' ) $country = 'Guinea';
  95. if( $code == 'GW' ) $country = 'Guinea-Bissau';
  96. if( $code == 'GY' ) $country = 'Guyana';
  97. if( $code == 'HT' ) $country = 'Haiti';
  98. if( $code == 'HM' ) $country = 'Heard Island and McDonald Islands';
  99. if( $code == 'VA' ) $country = 'Holy See (Vatican City State)';
  100. if( $code == 'HN' ) $country = 'Honduras';
  101. if( $code == 'HK' ) $country = 'Hong Kong';
  102. if( $code == 'HU' ) $country = 'Hungary';
  103. if( $code == 'IS' ) $country = 'Iceland';
  104. if( $code == 'IN' ) $country = 'India';
  105. if( $code == 'ID' ) $country = 'Indonesia';
  106. if( $code == 'IR' ) $country = 'Iran';
  107. if( $code == 'IQ' ) $country = 'Iraq';
  108. if( $code == 'IE' ) $country = 'Ireland';
  109. if( $code == 'IM' ) $country = 'Isle of Man';
  110. if( $code == 'IL' ) $country = 'Israel';
  111. if( $code == 'IT' ) $country = 'Italy';
  112. if( $code == 'JM' ) $country = 'Jamaica';
  113. if( $code == 'JP' ) $country = 'Japan';
  114. if( $code == 'JE' ) $country = 'Jersey';
  115. if( $code == 'JO' ) $country = 'Jordan';
  116. if( $code == 'KZ' ) $country = 'Kazakhstan';
  117. if( $code == 'KE' ) $country = 'Kenya';
  118. if( $code == 'KI' ) $country = 'Kiribati';
  119. if( $code == 'KP' ) $country = 'Korea';
  120. if( $code == 'KR' ) $country = 'Korea';
  121. if( $code == 'KW' ) $country = 'Kuwait';
  122. if( $code == 'KG' ) $country = 'Kyrgyz Republic';
  123. if( $code == 'LA' ) $country = 'Lao';
  124. if( $code == 'LV' ) $country = 'Latvia';
  125. if( $code == 'LB' ) $country = 'Lebanon';
  126. if( $code == 'LS' ) $country = 'Lesotho';
  127. if( $code == 'LR' ) $country = 'Liberia';
  128. if( $code == 'LY' ) $country = 'Libyan Arab Jamahiriya';
  129. if( $code == 'LI' ) $country = 'Liechtenstein';
  130. if( $code == 'LT' ) $country = 'Lithuania';
  131. if( $code == 'LU' ) $country = 'Luxembourg';
  132. if( $code == 'MO' ) $country = 'Macao';
  133. if( $code == 'MK' ) $country = 'Macedonia';
  134. if( $code == 'MG' ) $country = 'Madagascar';
  135. if( $code == 'MW' ) $country = 'Malawi';
  136. if( $code == 'MY' ) $country = 'Malaysia';
  137. if( $code == 'MV' ) $country = 'Maldives';
  138. if( $code == 'ML' ) $country = 'Mali';
  139. if( $code == 'MT' ) $country = 'Malta';
  140. if( $code == 'MH' ) $country = 'Marshall Islands';
  141. if( $code == 'MQ' ) $country = 'Martinique';
  142. if( $code == 'MR' ) $country = 'Mauritania';
  143. if( $code == 'MU' ) $country = 'Mauritius';
  144. if( $code == 'YT' ) $country = 'Mayotte';
  145. if( $code == 'MX' ) $country = 'Mexico';
  146. if( $code == 'FM' ) $country = 'Micronesia';
  147. if( $code == 'MD' ) $country = 'Moldova';
  148. if( $code == 'MC' ) $country = 'Monaco';
  149. if( $code == 'MN' ) $country = 'Mongolia';
  150. if( $code == 'ME' ) $country = 'Montenegro';
  151. if( $code == 'MS' ) $country = 'Montserrat';
  152. if( $code == 'MA' ) $country = 'Morocco';
  153. if( $code == 'MZ' ) $country = 'Mozambique';
  154. if( $code == 'MM' ) $country = 'Myanmar';
  155. if( $code == 'NA' ) $country = 'Namibia';
  156. if( $code == 'NR' ) $country = 'Nauru';
  157. if( $code == 'NP' ) $country = 'Nepal';
  158. if( $code == 'AN' ) $country = 'Netherlands Antilles';
  159. if( $code == 'NL' ) $country = 'Netherlands the';
  160. if( $code == 'NC' ) $country = 'New Caledonia';
  161. if( $code == 'NZ' ) $country = 'New Zealand';
  162. if( $code == 'NI' ) $country = 'Nicaragua';
  163. if( $code == 'NE' ) $country = 'Niger';
  164. if( $code == 'NG' ) $country = 'Nigeria';
  165. if( $code == 'NU' ) $country = 'Niue';
  166. if( $code == 'NF' ) $country = 'Norfolk Island';
  167. if( $code == 'MP' ) $country = 'Northern Mariana Islands';
  168. if( $code == 'NO' ) $country = 'Norway';
  169. if( $code == 'OM' ) $country = 'Oman';
  170. if( $code == 'PK' ) $country = 'Pakistan';
  171. if( $code == 'PW' ) $country = 'Palau';
  172. if( $code == 'PS' ) $country = 'Palestinian Territory';
  173. if( $code == 'PA' ) $country = 'Panama';
  174. if( $code == 'PG' ) $country = 'Papua New Guinea';
  175. if( $code == 'PY' ) $country = 'Paraguay';
  176. if( $code == 'PE' ) $country = 'Peru';
  177. if( $code == 'PH' ) $country = 'Philippines';
  178. if( $code == 'PN' ) $country = 'Pitcairn Islands';
  179. if( $code == 'PL' ) $country = 'Poland';
  180. if( $code == 'PT' ) $country = 'Portugal, Portuguese Republic';
  181. if( $code == 'PR' ) $country = 'Puerto Rico';
  182. if( $code == 'QA' ) $country = 'Qatar';
  183. if( $code == 'RE' ) $country = 'Reunion';
  184. if( $code == 'RO' ) $country = 'Romania';
  185. if( $code == 'RU' ) $country = 'Russian Federation';
  186. if( $code == 'RW' ) $country = 'Rwanda';
  187. if( $code == 'BL' ) $country = 'Saint Barthelemy';
  188. if( $code == 'SH' ) $country = 'Saint Helena';
  189. if( $code == 'KN' ) $country = 'Saint Kitts and Nevis';
  190. if( $code == 'LC' ) $country = 'Saint Lucia';
  191. if( $code == 'MF' ) $country = 'Saint Martin';
  192. if( $code == 'PM' ) $country = 'Saint Pierre and Miquelon';
  193. if( $code == 'VC' ) $country = 'Saint Vincent and the Grenadines';
  194. if( $code == 'WS' ) $country = 'Samoa';
  195. if( $code == 'SM' ) $country = 'San Marino';
  196. if( $code == 'ST' ) $country = 'Sao Tome and Principe';
  197. if( $code == 'SA' ) $country = 'Saudi Arabia';
  198. if( $code == 'SN' ) $country = 'Senegal';
  199. if( $code == 'RS' ) $country = 'Serbia';
  200. if( $code == 'SC' ) $country = 'Seychelles';
  201. if( $code == 'SL' ) $country = 'Sierra Leone';
  202. if( $code == 'SG' ) $country = 'Singapore';
  203. if( $code == 'SK' ) $country = 'Slovakia (Slovak Republic)';
  204. if( $code == 'SI' ) $country = 'Slovenia';
  205. if( $code == 'SB' ) $country = 'Solomon Islands';
  206. if( $code == 'SO' ) $country = 'Somalia, Somali Republic';
  207. if( $code == 'ZA' ) $country = 'South Africa';
  208. if( $code == 'GS' ) $country = 'South Georgia and the South Sandwich Islands';
  209. if( $code == 'ES' ) $country = 'Spain';
  210. if( $code == 'LK' ) $country = 'Sri Lanka';
  211. if( $code == 'SD' ) $country = 'Sudan';
  212. if( $code == 'SR' ) $country = 'Suriname';
  213. if( $code == 'SJ' ) $country = 'Svalbard & Jan Mayen Islands';
  214. if( $code == 'SZ' ) $country = 'Swaziland';
  215. if( $code == 'SE' ) $country = 'Sweden';
  216. if( $code == 'CH' ) $country = 'Switzerland, Swiss Confederation';
  217. if( $code == 'SY' ) $country = 'Syrian Arab Republic';
  218. if( $code == 'TW' ) $country = 'Taiwan';
  219. if( $code == 'TJ' ) $country = 'Tajikistan';
  220. if( $code == 'TZ' ) $country = 'Tanzania';
  221. if( $code == 'TH' ) $country = 'Thailand';
  222. if( $code == 'TL' ) $country = 'Timor-Leste';
  223. if( $code == 'TG' ) $country = 'Togo';
  224. if( $code == 'TK' ) $country = 'Tokelau';
  225. if( $code == 'TO' ) $country = 'Tonga';
  226. if( $code == 'TT' ) $country = 'Trinidad and Tobago';
  227. if( $code == 'TN' ) $country = 'Tunisia';
  228. if( $code == 'TR' ) $country = 'Turkey';
  229. if( $code == 'TM' ) $country = 'Turkmenistan';
  230. if( $code == 'TC' ) $country = 'Turks and Caicos Islands';
  231. if( $code == 'TV' ) $country = 'Tuvalu';
  232. if( $code == 'UG' ) $country = 'Uganda';
  233. if( $code == 'UA' ) $country = 'Ukraine';
  234. if( $code == 'AE' ) $country = 'United Arab Emirates';
  235. if( $code == 'GB' ) $country = 'United Kingdom';
  236. if( $code == 'US' ) $country = 'United States of America';
  237. if( $code == 'UM' ) $country = 'United States Minor Outlying Islands';
  238. if( $code == 'VI' ) $country = 'United States Virgin Islands';
  239. if( $code == 'UY' ) $country = 'Uruguay, Eastern Republic of';
  240. if( $code == 'UZ' ) $country = 'Uzbekistan';
  241. if( $code == 'VU' ) $country = 'Vanuatu';
  242. if( $code == 'VE' ) $country = 'Venezuela';
  243. if( $code == 'VN' ) $country = 'Vietnam';
  244. if( $code == 'WF' ) $country = 'Wallis and Futuna';
  245. if( $code == 'EH' ) $country = 'Western Sahara';
  246. if( $code == 'YE' ) $country = 'Yemen';
  247. if( $code == 'ZM' ) $country = 'Zambia';
  248. if( $code == 'ZW' ) $country = 'Zimbabwe';
  249. if( $country == '') $country = $code;
  250. return $country;
  251. }

Report this snippet  

You need to login to post a comment.