![]() |
php判断浏览器语言
/**
* 分析 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; } } |
| All times are GMT +8. The time now is 01:56 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.