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