<?php
function hw_delectlang() {
if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2) == 'en'){
$lang = 'en'; //English
} elseif (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2) == 'zh'){
if ((substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],3,2) != 'cn') && (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],3,2) != 'sg')){
$lang = 'cht'; //Chinese Trad.
} else {
$lang = 'chs'; //Chinese Simp.
}
} else {
$lang = 'en'; //Default is English
}
return $lang;
}
?>
Hope this works.
沒有留言:
發佈留言