![]() |
|
|||||||
| 代码交流 ASP,PHP,JSP等网站源代码下载与交流。 |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
IP: 218.2.67.10
|
|||
|
|||
|
/**
* 分析 HTTP_ACCEPT_LANGUAGE 的属性. * 这里只取第一语言设置 (其他可根据需要增强功能,这里只做简单的方法演示) * *author hcl * *date 2009-05-12 */ function browserType(){ preg_match(’/^([a-z\-]+)/i’, $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches); $lang = $matches[1]; switch ($lang) { case ‘zh-cn’ : header(’Location: http://www.0058.net/’); break; case ‘zh-tw’ : header(’Location: http://www.0058.net/’); break; default: break; } } |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|