The language information that the user can receive is put in $ _ SERVER ['http _ ACCEPT_LANGUAGE ']. the variable information is similar to this "zh-cn". for example, it is a multi-language column, the title is similar to "zh-cn, en; q = 0.8, ko; q = 0.5, zh-tw; q = 0.3 .? Phperr
The language information that the user can receive is stored in $ _ SERVER ['http _ ACCEPT_LANGUAGE,
The variable information is similar to this 'zh-cn'. for a multi-language column, it is similar to 'zh-cn, en; q = 0.8, ko; q = 0.5, zh-tw; q = 100'
The title below can be solved.
Error_reporting (E_ALL ^ E_NOTICE );
// Analyze the HTTP_ACCEPT_LANGUAGE attributes
// Here we only use the first language settings (other functions can be enhanced as needed. here we will only make a simple demonstration)
Preg_match ('/^ ([a-z \-])/I', $ _ SERVER ['http _ ACCEPT_LANGUAGE '], $ matches );
$ Lang = $ matches [1];
Switch ($ lang ){
Case 'zh-cn ':
Header ('Location: http://cn.webjx.com /');
Break;
Case 'zh-tw ':
Header ('Location: http://tw.webjx.com /');
Break;
Case 'Ko ':
Header ('Location: http://ko.webjx.com /');
Break;
Default:
Header ('Location: http://en.webjx.com /');
Break;
}
?>