手机访问PC页面时自动跳转到移动端页面

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33845254/article/details/79924755
public function _initialize()  
    {  
        $agent = $_SERVER['HTTP_USER_AGENT'];
        $toUrl = '';//页面跳转的页面-》移动端页面
		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:$toUrl");
    }  

展开阅读全文

没有更多推荐了,返回首页