Correlation function: $_server[' http_accept_language '];
Copy Code code as follows:
<?php
Header ("content-type:text/html; Charset=utf-8 ");
echo ' <br/> '. $_server[' http_accept_language '. ' <br/> ';
if (Strrpos (Strtolower ($_server[' http_accept_language ')), ' ZH-CN ')!== false) {
Echo ' <br/> You are the Chinese operating system <br/> ';
}
Else
{
Echo ' <br/> Non-Chinese operating system <br/> ';
}
?>
Annex: National Language table
AF Common Dutch
Af-za common Dutch – South Africa
Sq Albania
Sq-al Albania-Albania
Ar Arabic
Ar-dz Arabic-Algeria
AR-BH Arabic-Bahrain
Ar-eg Arabic-Egypt
Ar-iq Arabic-Iraq
Ar-jo Arabic-Jordan
AR-KW Arabic-Kuwait
AR-LB Arabic-Lebanon
Ar-ly Arabic-Libya
Ar-ma Arabic-Morocco
Ar-om Arabic-Oman
Ar-qa Arabic-Qatar
Ar-sa Arabic-Saudi Arabia
Ar-sy Arabic-Syrian Republic
Ar-tn Arabic-the Republic of North Africa
Ar-ae Arabic-United Arab Emirates
Ar-ye Arabic-Yemen
Hy Armenia
Hy-am Armenia-Armenia
AZ Azeri
Az-az-cyrl azeri-(Cyrillic) Azerbaijan
Az-az-latn Azeri (Latin)-Azerbaijan
European Union Basque
Eu-es Basque-Basque
Be Belarusian
Be-by belarusian-Belarus
BG Bulgaria
BG-BG Bulgaria-Bulgaria
CA ka Terronia
Ca-es ka Terronia-Cataronia
ZH-HK China-SAR in Hong Kong
Zh-mo China-Macau SAR
ZH-CN Hua-China
Zh-chs Hua (single)
Zh-sg Hua-Singapore
Zh-tw Hua-Taiwan
Zh-cht Hua (Traditional)
HR Croatia
Hr-hr Croatian-Croatian
CS Czech
Cs-cz Czech Republic-Czech Republic
Da Danish
DA-DK Danish-Denmark
Div Dhivehi
DIV-MV dhivehi-Maldives
NL Holland
nl-be Netherlands-Belgium
NL-NL Netherlands-Netherlands
En UK
En-au UK-Australia
EN-BZ UK-Belize
EN-CA UK-Canada
EN-CB United Kingdom-Caribbean Sea
En-ie UK-Ireland
EN-JM United Kingdom-Jamaica
EN-NZ UK – New Zealand
EN-PH British-Philippine Republic
En-za UK – South Africa
En-tt UK – Trinidad Trinidad Tobago Republic
EN-GB UK-United Kingdom
En-US UK-United States
EN-ZW UK-Zimbabwe
ET Estonia
Et-ee Estonia-Estonia
Fo Faroese
Fo-fo faroese-Faeroe Is.
FA Persian
Fa-ir Persian-Kingdom of Iran
Fi Finnish
Fi-fi Finnish-Finland
Fr France
Fr-be France-Belgium
FR-CA France-Canada
FR-FR France-France
Fr-lu France-Luxembourg
FR-MC France-Monaco
Fr-ch France-Switzerland
GL Galicia
Gl-es Galicia-Galicia
Ka Georgia State
Ka-ge State of Georgia-Georgia
De Germany
De-at Germany-Austria
DE-DE Germany-Germany
De-li Germany-Liechtenstein
De-lu Germany-Luxembourg
De-ch Germany-Switzerland
El Greece
EL-GR Greece-Greece
Gu Gujarati
Gu-in gujarati-India
He Hebrews
He-il Hebrew-Israel
Hi Hindi hindi
hi-in North India-India
Hu Hungary
Hu-hu Hungary-Hungary
Is Icelandic
Is-is Iceland-Iceland
ID Indonesia
Id-id Indonesia-Indonesia
It Italy
It-it Italy-Italy
It-ch Italy-Switzerland
JA Japan
JA-JP Japan-Japan
KN-Kanak language
Kn-in-India
KK Kazakh
Kk-kz kazakh-Kazakh
Kok Konkani
Kok-in konkani-India
KO Korea
KO-KR Korea-South Korea
KY Kyrgyz
Ky-kz kyrgyz-Kazakh
LV Latvia
LV-LV Latvia-Latvia
Lt Lithuania
Lt-lt Lithuania-Lithuania
MK Macedonia
MK-MK Macedonian-fyrom
Ms Malay
Ms-bn Malay-Brunei
Ms-my Malay-Malaysia
Mr Malay language
Mr-in Malay-India
MN Mongolia
Mn-mn Mongolia-Mongolia
No Norway
Nb-no Norway (BOKM?L) – Norway
Nn-no Norway (Nynorsk)-Norway
PL Poland
PL-PL Poland-Poland
PT Portugal
PT-BR Portugal-Brazil
PT-PT Portugal-Portugal
PA Punjab language
Pa-in Punjab-India
Ro Romanian
Ro-ro Romanian-Romania
RU Russia
Ru-ru Russia-Russia
SA Sanskrit
Sa-in Sanskrit-India
Sr-sp-cyrl Serbia-(Cyrillic) Republic of Serbia
Sr-sp-latn Serbia (Latin)-Republic of Serbia
SK Slovakia
Sk-sk Slovakia-Slovakia
SL Slovenia
SL-SI Slovenia-Slovenia
ES Spain
Es-ar Spain-Argentina
ES-BO Spain-Bolivia
ES-CL Spain-Chile
ES-CO Spain-Colombia
ES-CR Spain – Costa Rica
Es-do Spain – Domincan Rep.
ES-EC Spain-Ecuador
ES-SV Spain – El Salvador
ES-GT Spain-Guatemala
ES-HN Spain-Honduras
ES-MX Spain-Mexico
ES-NI Spain-Nicaragua
ES-PA Spain-Panama
ES-PY Spain-Paraguay
ES-PE Spain-Peru
ES-PR Spain – Puerto Rico
Es-es Spain-Spain
Es-uy Spain-Uruguay
ES-VE Spain-Venezuela
SW Swahili
Sw-ke swahili-Kenya
SV Sweden
Sv-fi Sweden-Finland
Sv-se Sweden-Sweden
Syr Syriac
Syr-sy syriac-Syrian Republic
Ta Tamil
Ta-in Tamil-India
TT Tatar
Tt-ru tatar-Russia
Te Telugu
Te-in telugu-India
Th Thailand
Th-th Thailand-Thailand
TR Turkish
TR-TR Turkish-Turkey
UK Ukraine
Uk-ua Ukraine-Ukraine
ur Urdu
UR-PK urdu-Pakistan
Uz Uzbek
Uz-uz-cyrl uzbek-(Cyrillic) Uzbekistan
Uz-uz-latn Uzbek (Latin)-Uzbekistan
VI Vietnam
VI-VN Vietnam-Vietnam