浏览器版本太低了,在兼容上存在很大的问题,调起来比较麻烦;在网上搜了一段,可以用(感谢原作者?)。
$agent = $_SERVER[‘HTTP_USER_AGENT‘];
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos
($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows
CE") || strpos($agent,"SymbianOS")){ header("Location:http://www.kissneck.com/m/"); exit;}
//ie6 ie7 ie8
$uarowser=$_SERVER[‘HTTP_USER_AGENT‘];
if(strstr($uarowser, ‘MSIE 6‘) || strstr($uarowser, ‘MSIE 7‘) || strstr($uarowser, ‘MSIE 8‘)){
echo ‘
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
</head>
<p class="browserupgrade">您的浏览器版本太低请到<a href="http://browsehappy.com">这里<a>升级,以获得最佳体验</p>
<style type="text/css">
.browserupgrade{
margin: 0;
padding: 10px;
background: #ccc;
text-align:center;
}
</style>
</html>
‘;
exit;//全面停止支持
}