Posted By

gilbitron on 07/08/10


Tagged

php html country continent


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

NyX
convergine
guillermoj88gmailcom


PHP Country Code to Continent


 / Published in: PHP
 

  1. function country_to_continent( $country ){
  2. $continent = '';
  3. if( $country == 'AF' ) $continent = 'Asia';
  4. if( $country == 'AX' ) $continent = 'Europe';
  5. if( $country == 'AL' ) $continent = 'Europe';
  6. if( $country == 'DZ' ) $continent = 'Africa';
  7. if( $country == 'AS' ) $continent = 'Oceania';
  8. if( $country == 'AD' ) $continent = 'Europe';
  9. if( $country == 'AO' ) $continent = 'Africa';
  10. if( $country == 'AI' ) $continent = 'North America';
  11. if( $country == 'AQ' ) $continent = 'Antarctica';
  12. if( $country == 'AG' ) $continent = 'North America';
  13. if( $country == 'AR' ) $continent = 'South America';
  14. if( $country == 'AM' ) $continent = 'Asia';
  15. if( $country == 'AW' ) $continent = 'North America';
  16. if( $country == 'AU' ) $continent = 'Oceania';
  17. if( $country == 'AT' ) $continent = 'Europe';
  18. if( $country == 'AZ' ) $continent = 'Asia';
  19. if( $country == 'BS' ) $continent = 'North America';
  20. if( $country == 'BH' ) $continent = 'Asia';
  21. if( $country == 'BD' ) $continent = 'Asia';
  22. if( $country == 'BB' ) $continent = 'North America';
  23. if( $country == 'BY' ) $continent = 'Europe';
  24. if( $country == 'BE' ) $continent = 'Europe';
  25. if( $country == 'BZ' ) $continent = 'North America';
  26. if( $country == 'BJ' ) $continent = 'Africa';
  27. if( $country == 'BM' ) $continent = 'North America';
  28. if( $country == 'BT' ) $continent = 'Asia';
  29. if( $country == 'BO' ) $continent = 'South America';
  30. if( $country == 'BA' ) $continent = 'Europe';
  31. if( $country == 'BW' ) $continent = 'Africa';
  32. if( $country == 'BV' ) $continent = 'Antarctica';
  33. if( $country == 'BR' ) $continent = 'South America';
  34. if( $country == 'IO' ) $continent = 'Asia';
  35. if( $country == 'VG' ) $continent = 'North America';
  36. if( $country == 'BN' ) $continent = 'Asia';
  37. if( $country == 'BG' ) $continent = 'Europe';
  38. if( $country == 'BF' ) $continent = 'Africa';
  39. if( $country == 'BI' ) $continent = 'Africa';
  40. if( $country == 'KH' ) $continent = 'Asia';
  41. if( $country == 'CM' ) $continent = 'Africa';
  42. if( $country == 'CA' ) $continent = 'North America';
  43. if( $country == 'CV' ) $continent = 'Africa';
  44. if( $country == 'KY' ) $continent = 'North America';
  45. if( $country == 'CF' ) $continent = 'Africa';
  46. if( $country == 'TD' ) $continent = 'Africa';
  47. if( $country == 'CL' ) $continent = 'South America';
  48. if( $country == 'CN' ) $continent = 'Asia';
  49. if( $country == 'CX' ) $continent = 'Asia';
  50. if( $country == 'CC' ) $continent = 'Asia';
  51. if( $country == 'CO' ) $continent = 'South America';
  52. if( $country == 'KM' ) $continent = 'Africa';
  53. if( $country == 'CD' ) $continent = 'Africa';
  54. if( $country == 'CG' ) $continent = 'Africa';
  55. if( $country == 'CK' ) $continent = 'Oceania';
  56. if( $country == 'CR' ) $continent = 'North America';
  57. if( $country == 'CI' ) $continent = 'Africa';
  58. if( $country == 'HR' ) $continent = 'Europe';
  59. if( $country == 'CU' ) $continent = 'North America';
  60. if( $country == 'CY' ) $continent = 'Asia';
  61. if( $country == 'CZ' ) $continent = 'Europe';
  62. if( $country == 'DK' ) $continent = 'Europe';
  63. if( $country == 'DJ' ) $continent = 'Africa';
  64. if( $country == 'DM' ) $continent = 'North America';
  65. if( $country == 'DO' ) $continent = 'North America';
  66. if( $country == 'EC' ) $continent = 'South America';
  67. if( $country == 'EG' ) $continent = 'Africa';
  68. if( $country == 'SV' ) $continent = 'North America';
  69. if( $country == 'GQ' ) $continent = 'Africa';
  70. if( $country == 'ER' ) $continent = 'Africa';
  71. if( $country == 'EE' ) $continent = 'Europe';
  72. if( $country == 'ET' ) $continent = 'Africa';
  73. if( $country == 'FO' ) $continent = 'Europe';
  74. if( $country == 'FK' ) $continent = 'South America';
  75. if( $country == 'FJ' ) $continent = 'Oceania';
  76. if( $country == 'FI' ) $continent = 'Europe';
  77. if( $country == 'FR' ) $continent = 'Europe';
  78. if( $country == 'GF' ) $continent = 'South America';
  79. if( $country == 'PF' ) $continent = 'Oceania';
  80. if( $country == 'TF' ) $continent = 'Antarctica';
  81. if( $country == 'GA' ) $continent = 'Africa';
  82. if( $country == 'GM' ) $continent = 'Africa';
  83. if( $country == 'GE' ) $continent = 'Asia';
  84. if( $country == 'DE' ) $continent = 'Europe';
  85. if( $country == 'GH' ) $continent = 'Africa';
  86. if( $country == 'GI' ) $continent = 'Europe';
  87. if( $country == 'GR' ) $continent = 'Europe';
  88. if( $country == 'GL' ) $continent = 'North America';
  89. if( $country == 'GD' ) $continent = 'North America';
  90. if( $country == 'GP' ) $continent = 'North America';
  91. if( $country == 'GU' ) $continent = 'Oceania';
  92. if( $country == 'GT' ) $continent = 'North America';
  93. if( $country == 'GG' ) $continent = 'Europe';
  94. if( $country == 'GN' ) $continent = 'Africa';
  95. if( $country == 'GW' ) $continent = 'Africa';
  96. if( $country == 'GY' ) $continent = 'South America';
  97. if( $country == 'HT' ) $continent = 'North America';
  98. if( $country == 'HM' ) $continent = 'Antarctica';
  99. if( $country == 'VA' ) $continent = 'Europe';
  100. if( $country == 'HN' ) $continent = 'North America';
  101. if( $country == 'HK' ) $continent = 'Asia';
  102. if( $country == 'HU' ) $continent = 'Europe';
  103. if( $country == 'IS' ) $continent = 'Europe';
  104. if( $country == 'IN' ) $continent = 'Asia';
  105. if( $country == 'ID' ) $continent = 'Asia';
  106. if( $country == 'IR' ) $continent = 'Asia';
  107. if( $country == 'IQ' ) $continent = 'Asia';
  108. if( $country == 'IE' ) $continent = 'Europe';
  109. if( $country == 'IM' ) $continent = 'Europe';
  110. if( $country == 'IL' ) $continent = 'Asia';
  111. if( $country == 'IT' ) $continent = 'Europe';
  112. if( $country == 'JM' ) $continent = 'North America';
  113. if( $country == 'JP' ) $continent = 'Asia';
  114. if( $country == 'JE' ) $continent = 'Europe';
  115. if( $country == 'JO' ) $continent = 'Asia';
  116. if( $country == 'KZ' ) $continent = 'Asia';
  117. if( $country == 'KE' ) $continent = 'Africa';
  118. if( $country == 'KI' ) $continent = 'Oceania';
  119. if( $country == 'KP' ) $continent = 'Asia';
  120. if( $country == 'KR' ) $continent = 'Asia';
  121. if( $country == 'KW' ) $continent = 'Asia';
  122. if( $country == 'KG' ) $continent = 'Asia';
  123. if( $country == 'LA' ) $continent = 'Asia';
  124. if( $country == 'LV' ) $continent = 'Europe';
  125. if( $country == 'LB' ) $continent = 'Asia';
  126. if( $country == 'LS' ) $continent = 'Africa';
  127. if( $country == 'LR' ) $continent = 'Africa';
  128. if( $country == 'LY' ) $continent = 'Africa';
  129. if( $country == 'LI' ) $continent = 'Europe';
  130. if( $country == 'LT' ) $continent = 'Europe';
  131. if( $country == 'LU' ) $continent = 'Europe';
  132. if( $country == 'MO' ) $continent = 'Asia';
  133. if( $country == 'MK' ) $continent = 'Europe';
  134. if( $country == 'MG' ) $continent = 'Africa';
  135. if( $country == 'MW' ) $continent = 'Africa';
  136. if( $country == 'MY' ) $continent = 'Asia';
  137. if( $country == 'MV' ) $continent = 'Asia';
  138. if( $country == 'ML' ) $continent = 'Africa';
  139. if( $country == 'MT' ) $continent = 'Europe';
  140. if( $country == 'MH' ) $continent = 'Oceania';
  141. if( $country == 'MQ' ) $continent = 'North America';
  142. if( $country == 'MR' ) $continent = 'Africa';
  143. if( $country == 'MU' ) $continent = 'Africa';
  144. if( $country == 'YT' ) $continent = 'Africa';
  145. if( $country == 'MX' ) $continent = 'North America';
  146. if( $country == 'FM' ) $continent = 'Oceania';
  147. if( $country == 'MD' ) $continent = 'Europe';
  148. if( $country == 'MC' ) $continent = 'Europe';
  149. if( $country == 'MN' ) $continent = 'Asia';
  150. if( $country == 'ME' ) $continent = 'Europe';
  151. if( $country == 'MS' ) $continent = 'North America';
  152. if( $country == 'MA' ) $continent = 'Africa';
  153. if( $country == 'MZ' ) $continent = 'Africa';
  154. if( $country == 'MM' ) $continent = 'Asia';
  155. if( $country == 'NA' ) $continent = 'Africa';
  156. if( $country == 'NR' ) $continent = 'Oceania';
  157. if( $country == 'NP' ) $continent = 'Asia';
  158. if( $country == 'AN' ) $continent = 'North America';
  159. if( $country == 'NL' ) $continent = 'Europe';
  160. if( $country == 'NC' ) $continent = 'Oceania';
  161. if( $country == 'NZ' ) $continent = 'Oceania';
  162. if( $country == 'NI' ) $continent = 'North America';
  163. if( $country == 'NE' ) $continent = 'Africa';
  164. if( $country == 'NG' ) $continent = 'Africa';
  165. if( $country == 'NU' ) $continent = 'Oceania';
  166. if( $country == 'NF' ) $continent = 'Oceania';
  167. if( $country == 'MP' ) $continent = 'Oceania';
  168. if( $country == 'NO' ) $continent = 'Europe';
  169. if( $country == 'OM' ) $continent = 'Asia';
  170. if( $country == 'PK' ) $continent = 'Asia';
  171. if( $country == 'PW' ) $continent = 'Oceania';
  172. if( $country == 'PS' ) $continent = 'Asia';
  173. if( $country == 'PA' ) $continent = 'North America';
  174. if( $country == 'PG' ) $continent = 'Oceania';
  175. if( $country == 'PY' ) $continent = 'South America';
  176. if( $country == 'PE' ) $continent = 'South America';
  177. if( $country == 'PH' ) $continent = 'Asia';
  178. if( $country == 'PN' ) $continent = 'Oceania';
  179. if( $country == 'PL' ) $continent = 'Europe';
  180. if( $country == 'PT' ) $continent = 'Europe';
  181. if( $country == 'PR' ) $continent = 'North America';
  182. if( $country == 'QA' ) $continent = 'Asia';
  183. if( $country == 'RE' ) $continent = 'Africa';
  184. if( $country == 'RO' ) $continent = 'Europe';
  185. if( $country == 'RU' ) $continent = 'Europe';
  186. if( $country == 'RW' ) $continent = 'Africa';
  187. if( $country == 'BL' ) $continent = 'North America';
  188. if( $country == 'SH' ) $continent = 'Africa';
  189. if( $country == 'KN' ) $continent = 'North America';
  190. if( $country == 'LC' ) $continent = 'North America';
  191. if( $country == 'MF' ) $continent = 'North America';
  192. if( $country == 'PM' ) $continent = 'North America';
  193. if( $country == 'VC' ) $continent = 'North America';
  194. if( $country == 'WS' ) $continent = 'Oceania';
  195. if( $country == 'SM' ) $continent = 'Europe';
  196. if( $country == 'ST' ) $continent = 'Africa';
  197. if( $country == 'SA' ) $continent = 'Asia';
  198. if( $country == 'SN' ) $continent = 'Africa';
  199. if( $country == 'RS' ) $continent = 'Europe';
  200. if( $country == 'SC' ) $continent = 'Africa';
  201. if( $country == 'SL' ) $continent = 'Africa';
  202. if( $country == 'SG' ) $continent = 'Asia';
  203. if( $country == 'SK' ) $continent = 'Europe';
  204. if( $country == 'SI' ) $continent = 'Europe';
  205. if( $country == 'SB' ) $continent = 'Oceania';
  206. if( $country == 'SO' ) $continent = 'Africa';
  207. if( $country == 'ZA' ) $continent = 'Africa';
  208. if( $country == 'GS' ) $continent = 'Antarctica';
  209. if( $country == 'ES' ) $continent = 'Europe';
  210. if( $country == 'LK' ) $continent = 'Asia';
  211. if( $country == 'SD' ) $continent = 'Africa';
  212. if( $country == 'SR' ) $continent = 'South America';
  213. if( $country == 'SJ' ) $continent = 'Europe';
  214. if( $country == 'SZ' ) $continent = 'Africa';
  215. if( $country == 'SE' ) $continent = 'Europe';
  216. if( $country == 'CH' ) $continent = 'Europe';
  217. if( $country == 'SY' ) $continent = 'Asia';
  218. if( $country == 'TW' ) $continent = 'Asia';
  219. if( $country == 'TJ' ) $continent = 'Asia';
  220. if( $country == 'TZ' ) $continent = 'Africa';
  221. if( $country == 'TH' ) $continent = 'Asia';
  222. if( $country == 'TL' ) $continent = 'Asia';
  223. if( $country == 'TG' ) $continent = 'Africa';
  224. if( $country == 'TK' ) $continent = 'Oceania';
  225. if( $country == 'TO' ) $continent = 'Oceania';
  226. if( $country == 'TT' ) $continent = 'North America';
  227. if( $country == 'TN' ) $continent = 'Africa';
  228. if( $country == 'TR' ) $continent = 'Asia';
  229. if( $country == 'TM' ) $continent = 'Asia';
  230. if( $country == 'TC' ) $continent = 'North America';
  231. if( $country == 'TV' ) $continent = 'Oceania';
  232. if( $country == 'UG' ) $continent = 'Africa';
  233. if( $country == 'UA' ) $continent = 'Europe';
  234. if( $country == 'AE' ) $continent = 'Asia';
  235. if( $country == 'GB' ) $continent = 'Europe';
  236. if( $country == 'US' ) $continent = 'North America';
  237. if( $country == 'UM' ) $continent = 'Oceania';
  238. if( $country == 'VI' ) $continent = 'North America';
  239. if( $country == 'UY' ) $continent = 'South America';
  240. if( $country == 'UZ' ) $continent = 'Asia';
  241. if( $country == 'VU' ) $continent = 'Oceania';
  242. if( $country == 'VE' ) $continent = 'South America';
  243. if( $country == 'VN' ) $continent = 'Asia';
  244. if( $country == 'WF' ) $continent = 'Oceania';
  245. if( $country == 'EH' ) $continent = 'Africa';
  246. if( $country == 'YE' ) $continent = 'Asia';
  247. if( $country == 'ZM' ) $continent = 'Africa';
  248. if( $country == 'ZW' ) $continent = 'Africa';
  249. return $continent;
  250. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: seloh77 on July 13, 2010

Wouldn't a switch be maybe better?

Posted By: kilise on September 17, 2013

AN ARRAY much better check mine

Posted By: ah72king on April 14, 2016

yes switch is much better

public function countrytocontinent($country){ $continent = ''; switch ($country) { case 'DE': case 'GG': case 'VA': case 'HU': case 'IS': case 'IE': case 'IM': case 'IT': case 'JE': case 'LV': case 'LI': case 'LT': case 'LU': case 'MK': case 'MT': case 'MD': case 'MC': case 'ME': case 'NL': case 'NO': case 'RO': case 'RU': case 'RS': case 'SK': case 'SI': case 'ES': case 'SJ': case 'SE': case 'CH': case 'UA': case 'GB': case 'GI': case 'GR': case 'AX': case 'AL': case 'AD': case 'AT': case 'BA': case 'BY': case 'BE': case 'BG': case 'CZ': case 'DK': case 'EE': case 'HR': case 'FI': case 'FR': case 'FO': case 'PL': case 'PT': case 'SM': $continent = 'Europe'; break;

        case 'GH':
        case 'DZ':
        case 'AO':
        case 'BJ':
        case 'BW':
        case 'BF':
        case 'BI':
        case 'CM':
        case 'CV':
        case 'CF':
        case 'TD':
        case 'KM':
        case 'CD':
        case 'CG':
        case 'CI':
        case 'DJ':
        case 'EG':
        case 'GQ':
        case 'ER':
        case 'ET':
        case 'GA':
        case 'GM':
        case 'GN':
        case 'GW':
        case 'KE':
        case 'LS':
        case 'LR':
        case 'LY':
        case 'MG':
        case 'MW':
        case 'ML':
        case 'MR':
        case 'MU':
        case 'YT':
        case 'MA':
        case 'MZ':
        case 'NA':
        case 'NE':
        case 'NG':
        case 'RE':
        case 'RW':
        case 'SH':
        case 'ST':
        case 'SN':
        case 'SC':
        case 'SL':
        case 'SO':
        case 'ZA':       
        case 'SD':
        case 'SZ':
        case 'TZ':
        case 'TG':
        case 'TN':
        case 'UG':
        case 'EH':
        case 'ZM':
        case 'ZW':

        $continent = 'Africa';

        break;

        case 'AF':
        case 'AM':
        case 'AZ':
        case 'BH':
        case 'BD':
        case 'BT':
        case 'IO':
        case 'BN':
        case 'KH':
        case 'CN':
        case 'CX':
        case 'CC':
        case 'CY':
        case 'GE':
        case 'HK':
        case 'IN':
        case 'ID':
        case 'IR':
        case 'IQ':
        case 'IL':
        case 'JP':
        case 'JO':
        case 'KZ':
        case 'KP':
        case 'KR':
        case 'KW':
        case 'KG':
        case 'LA':
        case 'LB':
        case 'MO':
        case 'MY':
        case 'MV':
        case 'MN':
        case 'MM':
        case 'NP':
        case 'OM':
        case 'PK':
        case 'PS':
        case 'PH':
        case 'QA':
        case 'SA':
        case 'SG':
        case 'LK':
        case 'SY':
        case 'TW':
        case 'TJ':
        case 'TH':
        case 'TL':
        case 'TR':
        case 'TM':
        case 'AE':
        case 'UZ':
        case 'VN':
        case 'YE':

        $continent = 'Asia';
        break;


    case 'AU':
    case 'AS':
    case 'CK':
    case 'FJ':
    case 'PF':
    case 'GU':
    case 'KI':
    case 'MH':
    case 'FM':
    case 'NR':
    case 'NC':
    case 'NZ':
    case 'NU':
    case 'NF':
    case 'MP':
    case 'PW':
    case 'PG':
    case 'PN':
    case 'WS':
    case 'SB':
    case 'TK':
    case 'TO':
    case 'TV':
    case 'UM':
    case 'VU':
    case 'WF':

    $continent = 'Oceania';
    break;

    case 'AQ':
    case 'BV':
    case 'TF':
    case 'HM':
    case 'GS':

    $continent = 'Antarctica';
    break;

    case 'AI':
    case 'AW':
    case 'AG':
    case 'BS':
    case 'BB':
    case 'BZ':
    case 'BM':
    case 'CA':
    case 'KY':
    case 'VG':
    case 'CR':
    case 'CU':
    case 'DM':
    case 'DO':
    case 'SV':
    case 'GL':
    case 'GD':
    case 'GP':
    case 'GT':
    case 'HT':
    case 'HN':
    case 'JM':
    case 'MQ':
    case 'MX':
    case 'MS':
    case 'NI':        
    case 'PA':
    case 'PR':
    case 'BL':
    case 'KN':
    case 'LC':
    case 'MF':
    case 'PM':
    case 'VC':
    case 'AN':
    case 'TT':
    case 'TC':
    case 'US':
    case 'VI':
    $continent = 'North America';
    break;

    case 'AR':
    case 'BO':
    case 'CL':
    case 'CO':
    case 'BR':
    case 'EC':
    case 'FK':
    case 'GF':
    case 'GY':
    case 'PY':
    case 'PE':
    case 'SR':
    case 'UY':
    case 'VE':
    $continent = 'South America';
    break;
    }

    return $continent;
}
Posted By: ah72king on April 14, 2016

public function countrytocontinent($country){ $continent = ''; switch ($country) { case 'DE': case 'GG': case 'VA': case 'HU': case 'IS': case 'IE': case 'IM': case 'IT': case 'JE': case 'LV': case 'LI': case 'LT': case 'LU': case 'MK': case 'MT': case 'MD': case 'MC': case 'ME': case 'NL': case 'NO': case 'RO': case 'RU': case 'RS': case 'SK': case 'SI': case 'ES': case 'SJ': case 'SE': case 'CH': case 'UA': case 'GB': case 'GI': case 'GR': case 'AX': case 'AL': case 'AD': case 'AT': case 'BA': case 'BY': case 'BE': case 'BG': case 'CZ': case 'DK': case 'EE': case 'HR': case 'FI': case 'FR': case 'FO': case 'PL': case 'PT': case 'SM': $continent = 'Europe'; break;

        case 'GH':
        case 'DZ':
        case 'AO':
        case 'BJ':
        case 'BW':
        case 'BF':
        case 'BI':
        case 'CM':
        case 'CV':
        case 'CF':
        case 'TD':
        case 'KM':
        case 'CD':
        case 'CG':
        case 'CI':
        case 'DJ':
        case 'EG':
        case 'GQ':
        case 'ER':
        case 'ET':
        case 'GA':
        case 'GM':
        case 'GN':
        case 'GW':
        case 'KE':
        case 'LS':
        case 'LR':
        case 'LY':
        case 'MG':
        case 'MW':
        case 'ML':
        case 'MR':
        case 'MU':
        case 'YT':
        case 'MA':
        case 'MZ':
        case 'NA':
        case 'NE':
        case 'NG':
        case 'RE':
        case 'RW':
        case 'SH':
        case 'ST':
        case 'SN':
        case 'SC':
        case 'SL':
        case 'SO':
        case 'ZA':       
        case 'SD':
        case 'SZ':
        case 'TZ':
        case 'TG':
        case 'TN':
        case 'UG':
        case 'EH':
        case 'ZM':
        case 'ZW':

        $continent = 'Africa';

        break;

        case 'AF':
        case 'AM':
        case 'AZ':
        case 'BH':
        case 'BD':
        case 'BT':
        case 'IO':
        case 'BN':
        case 'KH':
        case 'CN':
        case 'CX':
        case 'CC':
        case 'CY':
        case 'GE':
        case 'HK':
        case 'IN':
        case 'ID':
        case 'IR':
        case 'IQ':
        case 'IL':
        case 'JP':
        case 'JO':
        case 'KZ':
        case 'KP':
        case 'KR':
        case 'KW':
        case 'KG':
        case 'LA':
        case 'LB':
        case 'MO':
        case 'MY':
        case 'MV':
        case 'MN':
        case 'MM':
        case 'NP':
        case 'OM':
        case 'PK':
        case 'PS':
        case 'PH':
        case 'QA':
        case 'SA':
        case 'SG':
        case 'LK':
        case 'SY':
        case 'TW':
        case 'TJ':
        case 'TH':
        case 'TL':
        case 'TR':
        case 'TM':
        case 'AE':
        case 'UZ':
        case 'VN':
        case 'YE':

        $continent = 'Asia';
        break;


    case 'AU':
    case 'AS':
    case 'CK':
    case 'FJ':
    case 'PF':
    case 'GU':
    case 'KI':
    case 'MH':
    case 'FM':
    case 'NR':
    case 'NC':
    case 'NZ':
    case 'NU':
    case 'NF':
    case 'MP':
    case 'PW':
    case 'PG':
    case 'PN':
    case 'WS':
    case 'SB':
    case 'TK':
    case 'TO':
    case 'TV':
    case 'UM':
    case 'VU':
    case 'WF':

    $continent = 'Oceania';
    break;

    case 'AQ':
    case 'BV':
    case 'TF':
    case 'HM':
    case 'GS':

    $continent = 'Antarctica';
    break;

    case 'AI':
    case 'AW':
    case 'AG':
    case 'BS':
    case 'BB':
    case 'BZ':
    case 'BM':
    case 'CA':
    case 'KY':
    case 'VG':
    case 'CR':
    case 'CU':
    case 'DM':
    case 'DO':
    case 'SV':
    case 'GL':
    case 'GD':
    case 'GP':
    case 'GT':
    case 'HT':
    case 'HN':
    case 'JM':
    case 'MQ':
    case 'MX':
    case 'MS':
    case 'NI':        
    case 'PA':
    case 'PR':
    case 'BL':
    case 'KN':
    case 'LC':
    case 'MF':
    case 'PM':
    case 'VC':
    case 'AN':
    case 'TT':
    case 'TC':
    case 'US':
    case 'VI':
    $continent = 'North America';
    break;

    case 'AR':
    case 'BO':
    case 'CL':
    case 'CO':
    case 'BR':
    case 'EC':
    case 'FK':
    case 'GF':
    case 'GY':
    case 'PY':
    case 'PE':
    case 'SR':
    case 'UY':
    case 'VE':
    $continent = 'South America';
    break;
    }

    return $continent;
}

You need to login to post a comment.