01 |
$language = substr ( $_SERVER [ 'HTTP_ACCEPT_LANGUAGE' ],0,2); |
02 |
//获取访客语言,是HTTP头信息的ACCEPT_LANGUAGE的前两个字符 |
04 |
if ( $language != 'zh' ){ |
05 |
//zh是中文,包括zh-CN简体中文和zh-TW正体中文 |
06 |
header( "Location: /yourpage.html" ); |
07 |
//这句代码是将用户转向到根目录的yourpage.html这里 |
[代码] [PHP]代码
3 |
$language = substr ( $_SERVER [ 'HTTP_ACCEPT_LANGUAGE' ],0,2); |
5 |
echo '<noscript><noscript>' ; |
|