search
HomeBackend DevelopmentPHP TutorialPHP version country code, abbreviation query function code_PHP tutorial

PHP version country code, abbreviation query function code_PHP tutorial

Jul 21, 2016 pm 03:25 PM
functionphpcodefunctionnationcopyInquireVersionabbreviation

Copy code The code is as follows:

function transCountryCode($code) {
$index=array('AA'=>'阿鲁巴',
'AD'=>'安道尔',
'AE'=>'阿联酋',
'AF'=>'阿富汗',
'AG'=>'安提瓜和巴布达',
'AL'=>'阿尔巴尼亚',
'AM'=>'亚美尼亚',
'AN'=>'荷属安德列斯',
'AO'=>'安哥拉',
'AQ'=>'南极洲',
'AR'=>'阿根廷',
'AS'=>'东萨摩亚',
'AT'=>'奥地利',
'AU'=>'澳大利亚',
'AZ'=>'阿塞拜疆',
'Av'=>'安圭拉岛',
'BA'=>'波黑',
'BB'=>'巴巴多斯',
'BD'=>'孟加拉',
'BE'=>'比利时',
'BF'=>'巴哈马',
'BF'=>'布基纳法索',
'BG'=>'保加利亚',
'BH'=>'巴林',
'BI'=>'布隆迪',
'BJ'=>'贝宁',
'BM'=>'百慕大',
'BN'=>'文莱布鲁萨兰',
'BO'=>'玻利维亚',
'BR'=>'巴西',
'BS'=>'巴哈马',
'BT'=>'不丹',
'BV'=>'布韦岛',
'BW'=>'博茨瓦纳',
'BY'=>'白俄罗斯',
'BZ'=>'伯里兹',
'CA'=>'加拿大',
'CB'=>'柬埔寨',
'CC'=>'可可斯群岛',
'CD'=>'刚果',
'CF'=>'中非',
'CG'=>'刚果',
'CH'=>'瑞士',
'CI'=>'象牙海岸',
'CK'=>'库克群岛',
'CL'=>'智利',
'CM'=>'喀麦隆',
'CN'=>'中国',
'CO'=>'哥伦比亚',
'CR'=>'哥斯达黎加',
'CS'=>'捷克斯洛伐克',
'CU'=>'古巴',
'CV'=>'佛得角',
'CX'=>'圣诞岛',
'CY'=>'塞普路斯',
'CZ'=>'捷克',
'DE'=>'德国',
'DJ'=>'吉布提',
'DK'=>'丹麦',
'DM'=>'多米尼加共和国',
'DO'=>'多米尼加联邦',
'DZ'=>'阿尔及利亚',
'EC'=>'厄瓜多尔',
'EE'=>'爱沙尼亚',
'EG'=>'埃及',
'EH'=>'西撒哈拉',
'ER'=>'厄立特里亚',
'ES'=>'西班牙',
'ET'=>'埃塞俄比亚',
'FI'=>'芬兰',
'FJ'=>'斐济',
'FK'=>'福兰克群岛',
'FM'=>'米克罗尼西亚',
'FO'=>'法罗群岛',
'FR'=>'法国',
'FX'=>'法国-主教区',
'GA'=>'加蓬',
'GB'=>'英国',
'GD'=>'格林纳达',
'GE'=>'格鲁吉亚',
'GF'=>'法属圭亚那',
'GH'=>'加纳',
'GI'=>'直布罗陀',
'GL'=>'格陵兰岛',
'GM'=>'冈比亚',
'GN'=>'几内亚',
'GP'=>'法属德洛普群岛',
'GQ'=>'赤道几内亚',
'GR'=>'希腊',
'GS'=>'S. Georgia and S. Sandwich Isls.',
'GT'=>'危地马拉',
'GU'=>'关岛',
'GW'=>'几内亚比绍',
'GY'=>'圭亚那',
'HK'=>'中国香港特区',
'HM'=>'赫德和麦克唐纳群岛',
'HN'=>'洪都拉斯',
'HR'=>'克罗地亚',
'HT'=>'海地',
'HU'=>'匈牙利',
'ID'=>'印度尼西亚',
'IE'=>'爱尔兰',
'IL'=>'以色列',
'IN'=>'印度',
'IO'=>'英属印度洋领地',
'IQ'=>'伊拉克',
'IR'=>'伊朗',
'IS'=>'冰岛',
'IT'=>'意大利',
'JM'=>'牙买加',
'JO'=>'约旦',
'JP'=>'日本',
'KE'=>'肯尼亚',
'KG'=>'吉尔吉斯斯坦',
'KH'=>'柬埔寨',
'KI'=>'基里巴斯',
'KM'=>'科摩罗',
'KN'=>'圣基茨和尼维斯',
'KP'=>'韩国',
'KR'=>'朝鲜',
'KW'=>'科威特',
'KY'=>'开曼群岛',
'KZ'=>'哈萨克斯坦',
'LA'=>'老挝',
'LB'=>'黎巴嫩',
'LC'=>'圣卢西亚',
'LI'=>'列支顿士登',
'LK'=>'斯里兰卡',
'LR'=>'利比里亚',
'LS'=>'莱索托',
'LT'=>'立陶宛',
'LU'=>'卢森堡',
'LV'=>'拉托维亚',
'LY'=>'利比亚',
'MA'=>'摩洛哥',
'MC'=>'摩纳哥',
'MD'=>'摩尔多瓦',
'MG'=>'马达加斯加',
'MH'=>'马绍尔群岛',
'MK'=>'马其顿',
'ML'=>'马里',
'MM'=>'缅甸',
'MN'=>'蒙古',
'MO'=>'中国澳门特区',
'MP'=>'北马里亚纳群岛',
'MQ'=>'法属马提尼克群岛',
'MR'=>'毛里塔尼亚',
'MS'=>'蒙塞拉特岛',
'MT'=>'马耳他',
'MU'=>'毛里求斯',
'MV'=>'马尔代夫',
'MW'=>'马拉维',
'MX'=>'Mexico',
'MY'=>'Malaysia',
'MZ'=>'Mozambique',
'NA'=>'Namibia',
'NC'=>'New Caledonia',
'NE'=>'Niger',
'NF'=>'Norfolk Island',
' NG'=>'Nigeria',
'NI'=>'Nicaragua',
'NL'=>'Netherlands',
'NO'=>'Norway',
'NP'=>'Nepal',
'NR'=>'Nauru',
'NT'=>'Neutral Zone (Saudi Arabia-Iraq)',
'NU '=>'New Zealand',
'NZ'=>'New Zealand',
'OM'=>'Oman',
'PA'=>'Panama',
'PE'=>'Peru',
'PF'=>'French Polynesia',
'PG'=>'Papua New Guinea',
'PH' =>'Philippines',
'PK'=>'Pakistan',
'PL'=>'Poland',
'PM'=>'Saint Pierre and Miquelon Islands',
'PN'=>'Pitcairn Island',
'PR'=>'Puerto Rico',
'PT'=>'Portugal',
'PW '=>'Palau',
'PY'=>'Paraguay',
'QA'=>'Qatar',
'RE'=>'French Nieuwan Island',
'RO'=>'Romania',
'RU'=>'Russia',
'RW'=>'Rwanda',
'SA'=> ;'Saudi Arabia',
'SC'=>'Seychelles',
'SD'=>'Sudan',
'SE'=>'Sweden',
'SG'=>'Singapore',
'SH'=>'Saint Helena',
'SI'=>'Slovenia',
'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'=>'Former Soviet Union',
'SV'=>'El Salvador',
'SY'=>'Syria',
'SZ'=>'Swaziland',
'Sb'=>'Solomon Islands',
'TC'=>'Turks and Caicos Islands',
'TD'=>'Chad',
'TF'=>'Southern French Territory',
'TG'=>'Togo',
'TH'=> 'Thailand',
'TJ'=>'Tajikistan',
'TK'=>'Tokelau Islands',
'TM'=>'Turkmenistan',
'TN'=>'Tunisia',
'TO'=>'Tonga',
'TP'=>'East Timor',
'TR'=>'Turkey ',
'TT'=>'Trinidad and Tobago',
'TV'=>'Tuvalu',
'TW'=>'Taiwan Province of China ',
'TZ'=>'Tanzania',
'UA'=>'Ukraine',
'UG'=>'Uganda',
'UK'=> 'UK',
'UM'=>'US Overseas Territories',
'US'=>'United States',
'UY'=>'Uruguay',
'UZ '=>'Uzbekistan',
'VA'=>'Vatican',
'VC'=>'Saint Vincent and the Grenadines',
'VE'= >'Venezuela',
'VG'=>'British Virgin Islands',
'VI'=>'U.S. Virgin Islands',
'VN'=>' Vietnam',
'VU'=>'Vanuaro',
'WF'=>'Varis and Fortuna',
'WS'=>'Western Samoa Asia',
'YE'=>'Yemen',
'YT'=>'Mayotte',
'YU'=>'Yugoslavia',
'ZA '=>'South Africa',
'ZM'=>'Zambia',
'ZR'=>'Zaire',
'ZW'=>'Zimbabwe');
$code=strtoupper($code);
$name=$index[$code];
if (emptyempty($name)) {
return null;
}
return $name;
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324147.htmlTechArticleCopy the code as follows: ?php function transCountryCode($code) { $index=array('AA'=' Aruba', 'AD'='Andorra', 'AE'='UAE', 'AF'='Afghanistan', 'AG'='Antigua and Barbuda'...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version