PHP version of the Country Code, abbreviated query function code _php tips

Source: Internet
Author: User
Copy Code code as follows:

<?php
function Transcountrycode ($code) {
$index =array (' AA ' => ' Aruba '),
' AD ' => ' Andorra ',
' AE ' => ' UAE ',
' AF ' => ' Afghanistan ',
' AG ' => ' Antigua And Barbuda ',
' AL ' => ' Albania ',
' AM ' => ' Armenia ',
' An ' => ' Andreas ',
' AO ' => ' Angola ',
' AQ ' => ' Antarctica ',
' AR ' => ' Argentina ',
' As ' => ' Eastern Samoa ',
' At ' => ' Austria ',
' AU ' => ' Australia ',
' AZ ' => ' Azerbaijan ',
' Av ' => ' Anguilla ',
' BA ' => ' BiH ',
' BB ' => ' Barbados ',
' BD ' => ' Bengal ',
' Be ' => ' Belgium ',
' BF ' => ' Bahamas ',
' BF ' => ' Bourkina-faso ',
' BG ' => ' Bulgaria ',
' BH ' => ' Bahrain ',
' BI ' => ' Burundi ',
' BJ ' => ' Benin ',
' BM ' => ' Bermuda ',
' BN ' => ' Brunei Brussalan ',
' BO ' => ' Bolivia ',
' BR ' => ' Brazil ',
' BS ' => ' Bahamas ',
' BT ' => ' Bhutan ',
' BV ' => ' Bouves ',
' BW ' => ' Botswana ',
' By ' => ' Belarus ',
' BZ ' => ' Burlington ',
' CA ' => ' Canada ',
' CB ' => ' Cambodia ',
' CC ' => ' Coco Islands ',
' CD ' => ' Congo ',
' CF ' => ' Central Africa ',
' CG ' => ' Congo ',
' CH ' => ' Switzerland ',
' CI ' => ' Ivory Coast ',
' CK ' => ' Cook Is. ',
' CL ' => ' Chile ',
' CM ' => ' Cameroon ',
' CN ' => ' China ',
' CO ' => ' Columbia ',
' CR ' => ' Costa Rica ',
' CS ' => ' Ceskoslovensko ',
' CU ' => ' Cuba ',
' CV ' => ' Cape Verde ',
' CX ' => ' Christmas Island ',
' CY ' => ' Cyprus ',
' CZ ' => ' Czech ',
' DE ' => ' Germany ',
' DJ ' => ' Djibouti ',
' DK ' => ' Denmark ',
' DM ' => ' Domincan Rep. ',
' Do ' => ' Commonwealth of Dominica ',
' DZ ' => ' Algeria ',
' EC ' => ' Ecuador ',
' EE ' => ' Estonia ',
' EG ' => ' Egypt ',
' EH ' => ' Sahara Occidental ',
' ER ' => ' Eritrea ',
' ES ' => ' Spain ',
' ET ' => ' Ethiopia ',
' FI ' => ' Finland ',
' FJ ' => ' Fiji ',
' FK ' => ' Frank Islands ',
' FM ' => ' Micronesia ',
' FO ' => ' Faeroe Is. ',
' FR ' => ' France ',
' FX ' => ' France-Bishop district ',
' GA ' => ' Gabon ',
' GB ' => ' UK ',
' GD ' => ' Grenada ',
' GE ' => ' Georgia ',
' GF ' => ' French Guiana ',
' GH ' => ' Ghana ',
' GI ' => ' Gibraltar ',
' GL ' => ' Greenland ',
' GM ' => ' Gambia ',
' GN ' => ' Guinea ',
' GP ' => ' French Guadeloupe Islands ',
' GQ ' => ' Equatorial Guinea ',
' GR ' => ' Greece ',
' GS ' => ' s. Georgia and S. Sandwich ISLs. ',
' GT ' => ' Guatemala ',
' GU ' => ' Guam ',
' GW ' => ' Guinea-Bissau ',
' GY ' => ' Guyana ',
' HK ' => ' China SAR ',
' HM ' => ' Hurd and McDonald Islands ',
' HN ' => ' Honduras ',
' HR ' => ' Croatia ',
' HT ' => ' Haiti ',
' HU ' => ' Hungary ',
' ID ' => ' Indonesia ',
' IE ' => ' Ireland ',
' IL ' => ' Israel ',
' In ' => ' India ',
' IO ' => ' British Indian Ocean Territory ',
' IQ ' => ' Iraq ',
' IR ' => ' Iran ',
' Is ' => ' Iceland ',
' IT ' => ' Italy ',
' JM ' => ' Jamaica ',
' JO ' => ' Jordan ',
' JP ' => ' Japan ',
' KE ' => ' Kenya ',
' KG ' => ' Kyrgyzstan ',
' KH ' => ' Cambodia ',
' KI ' => ' Kiribati ',
' KM ' => ' Comoros ',
' KN ' => ' Saint Kitts-nevis ',
' KP ' => ' Korea ',
' KR ' => ' North Korea ',
' KW ' => ' Kuwait ',
' KY ' => ' Caimas, Is. ',
' KZ ' => ' Kazakhstan ',
' LA ' => ' Laos ',
' LB ' => ' Lebanon ',
' LC ' => ' Saint Lucia ',
' LI ' => ',
' LK ' => ' Sri Lanka ',
' LR ' => ' Liberia ',
' LS ' => ' Lesotho ',
' LT ' => ' Lithuania ',
' LU ' => ' Luxembourg ',
' LV ' => ' Latvia ',
' LY ' => ' Libya ',
' MA ' => ' Morocco ',
' MC ' => ' Monaco ',
' MD ' => ' Moldova ',
' MG ' => ' Madagascar ',
' MH ' => ' Marshall Islands ',
' MK ' => ' Macedonia ',
' ML ' => ' Mali ',
' MM ' => ' Burma ',
' MN ' => ' Mongolia ',
' MO ' => ' China MSAR ',
' MP ' => ' Northern Mariana Islands ',
' MQ ' => ' Martinique islands ',
' MR ' => ' Mauritania ',
' MS ' => ' Monserrate Island ',
' MT ' => ' Malta ',
' MU ' => ' Mauritius ',
' MV ' => ' Maldives ',
' MW ' => ' Malawi ',
' MX ' => ' Mexico ',
' My ' => ' Malaysia ',
' MZ ' => ' Mozambique ',
' NA ' => ' Namibia ',
' NC ' => ' new-Carney ',
' NE ' => ' Niger ',
' NF ' => ' Norfolk I. ',
' NG ' => ' Nigeria ',
' NI ' => ' Nicaragua ',
' NL ' => ' Holland ',
' NO ' => ' Norway ',
' NP ' => ' Nepal ',
' NR ' => ' Nauru ',
' NT ' => ' neutral zone (Saudi-Iraq) ',
' NU ' => ' love ',
' NZ ' => ' New Zealand ',
' OM ' => ' Oman ',
' PA ' => ' Panama ',
' PE ' => ' Peru ',
' PF ' => ' French Polynesian ',
' PG ' => ' Papua New Guinea ',
' PH ' => ' Philippines ',
' PK ' => ' Pakistan ',
' PL ' => ' Poland ',
' PM ' => ' Saint-Piaire and the secret Clone Islands ',
' PN ' => ' Pitcairn Island ',
' PR ' => ' Puerto Rico ',
' PT ' => ' Portugal ',
' PW ' => ' Palau ',
' PY ' => ' Paraguay ',
' QA ' => ' Qatar ',
' RE ' => ' French Niliuwang Island ',
' RO ' => ' Romania ',
' RU ' => ' Russia ',
' RW ' => ' Rwanda ',
' SA ' => ' Saudi Arabia ',
' SC ' => ' Seychelles ',
' SD ' => ' Sudan ',
' SE ' => ' Sweden ',
' SG ' => ' Singapore ',
' SH ' => ' St. Helena ',
' SI ' => ' Srovenia ',
' SJ ' => ' Svalbard and Jan Mayen ',
' SK ' => ' Slovakia ',
' SL ' => ' Sierra Leone ',
' SM ' => ' San Marino ',
' SN ' => ' Senegal ',
' So ' => ' Somalia ',
' SR ' => ' Suriname ',
' ST ' => ' Sao Tome And Principe ',
' SU ' => ' the former Soviet Union ',
' SV ' => ' El Salvador ',
' SY ' => ' Syria ',
' SZ ' => ' Swaziland ',
' Sb ' => ' Solomon Islands ',
' TC ' => ' Turks And Caicos Is. ',
' TD ' => ' Chad ',
' TF ' => ' southern French territory ',
' TG ' => ' Togo ',
' TH ' => ' Thailand ',
' TJ ' => ' Tajikistan ',
' TK ' => ' Tokelau Is. ',
' TM ' => ' Turkmenistan ',
' TN ' => ' Tunisia ',
' To ' => ' Tonga ',
' TP ' => ' East Timor ',
' TR ' => ' the Earth ',
' TT ' => ' Trinidad And Tobago ',
' TV ' => ' Tuvalu ',
' TW ' => ' China Taiwan Province ',
' TZ ' => ' Tanzania ',
' UA ' => ' Ukraine ',
' UG ' => ' Uganda ',
' UK ' => ' England ',
' UM ' => ' US Overseas Territories ',
' Us ' => ' America ',
' UY ' => ' Uruguay ',
' UZ ' => ' Uzbekistan ',
' VA ' => ' Vatican ',
' VC ' => ' St Vincent and Greenock Nadins ',
' VE ' => ' Venezuela ',
' VG ' => ' British Virgin Islands ',
' VI ' => ' US Virgin Islands ',
' VN ' => ' Vietnam ',
' VU ' => ' Vanuaru ',
' WF ' => ' Varys and Fortuna Islands ',
' WS ' => ' Western Samoa ',
' YE ' => ' Yemen ',
' YT ' => ' Mahorais ',
' YU ' => ' Yugoslavia ',
' ZA ' => ' South Africa ',
' ZM ' => ' Zambia ',
' ZR ' => ' Zaire ',
' ZW ' => ' Zimbabwe ');
$code =strtoupper ($code);
$name = $index [$code];
if (Emptyempty ($name)) {
return null;
}
return $name;
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.