KURUN CLOUD洛杉矶服务器,CN2GIA+CUPM9929+CMIN2,顶级回国线路,机房直销
<script>
if(navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null){ //判断是否为移动端
if( window.location.host != 'm.xxx.com' ){
window.location = 'http://m.xxx.com' + window.location.pathname; //带路径跳转
}
}
</script>
function ismobile(){
if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) {
return true;
} else {
if (isset($_SERVER['HTTP_VIA']) && stripos($_SERVER['HTTP_VIA'], 'wap') !== false) {
return true;
} else {
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(blackberry|configuration\\/cldc|hp |hp-|htc |htc_|htc-|iemobile|kindle|midp|mmp|motorola|mobile|nokia|opera mini|opera |Googlebot-Mobile|YahooSeeker\\/M1A1-R2D2|android|iphone|ipod|mobi|palm|palmos|phone|pocket|portalmmm|ppc;|smartphone|sonyericsson|sqh|spv|symbian|treo|up.browser|up.link|vodafone|wap|windows ce|xda |xda_|xoom)/i', $_SERVER['HTTP_USER_AGENT'])) {
return true;
} else {
if (isset($_SERVER['HTTP_ACCEPT']) && stripos($_SERVER['HTTP_ACCEPT'], 'text/html') === false && (stripos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false || stripos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.xhtml+xml') !== false)) {
return true;
} else {
return false;
}
}
}
}
}