时间:2023-09-12加入收藏
<script type="text/javascript">
var system ={
win : false,
mac : false,
xll : false
};
var p = navigator.platform;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
if(system.win||system.mac||system.xll){
window.location.href="https://baidu.com"; //跳转地址
}</script>
<?php
function strexists2($string, $find) { return !(strpos($string, $find) === false); }
function deep_in_array2($value, $array) {
foreach($array as $item) {
if(!is_array($item)) {
if (strpos($value, $item) !== false) {
return true;
} else { continue; } }
if(in_array($value, $item)) {
return true;
} else if(deep_in_array($value, $item)) {
return true;
}
} return false; }
function mobile() {
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
$ualist = array('android', 'midp', 'nokia', 'mobile', 'iphone', 'ipod', 'blackberry', 'windows phone');
if((deep_in_array2($useragent, $ualist) || strexists2($_SERVER['HTTP_ACCEPT'], "VND.WAP") || strexists2($_SERVER['HTTP_VIA'],"wap")))
if(strpos($useragent,'iphone')!==false||strpos($useragent,'ipod')!==false) return '苹果'; else return '安卓';
else
return '电脑'; }
if(mobile()=='电脑'){ exit(header("location:https://baidu.com")); } //跳转地址