PHP代码:
$lan = substr(?$HTTP_ACCEPT_LANGUAGE,0,5);
if ($lan == "zh-cn")
print("");
else
print("");
?>
HTML网页根据来访这的浏览器语言不同自动跳转多语言页面
在
之间加入如下代码。
<script> <BR>var type=navigator.appName <BR>if (type=="Netscape") <BR>var lang = navigator.language <BR>else <BR>var lang = navigator.userLanguage <br><br>//cut down to first 2 chars of country code <BR>var lang = lang.substr(0,2) <br><br>// 英语 <BR>if (lang == "en") <BR>window.location.replace('url') <br><br>// 简体中文 <BR>else if (lang == "zh-cn") <BR>window.location.replace('url') <br><br>// 繁体中文 <BR>else if (lang == "zh-tw") <BR>window.location.replace('url') <br><br>// 德语 <BR>else if (lang == "de") <BR>window.location.replace('url') <br><br>// 除上面所列的语言 <BR>else <BR>window.location.replace('url') <br><br></script>
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