php多语言判断

<?
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2);
//echo $lan;
if ($lan == "zh")
print("<meta http-equiv='refresh' content = '0;URL = /zh'>");
elseif ($lan == "zh")
print("<meta http-equiv='refresh' content = '0;URL = /zh'>");
elseif ($lan == "en")
print("<meta http-equiv='refresh' content = '0;URL = /en'>");
elseif ($lan == "ar")
print("<meta http-equiv='refresh' content = '0;URL = /Arabic'>");
elseif ($lan == "id")
print("<meta http-equiv='refresh' content = '0;URL = /Indonesia'>");
elseif ($lan == "th")
print("<meta http-equiv='refresh' content = '0;URL = /Thai'>");
elseif ($lan == "vi")
print("<meta http-equiv='refresh' content = '0;URL = /Vietnamese'>");
elseif ($lan == "es")
print("<meta http-equiv='refresh' content = '0;URL = /Spanish'>");
elseif ($lan == "pt")
print("<meta http-equiv='refresh' content = '0;URL = /Portuguese-Brazil'>");
else
print("<meta http-equiv='refresh' content = '0;URL = /en'>");
?>

posted @ 2022-03-29 20:03  阿波罗任先生  阅读(125)  评论(0编辑  收藏  举报