require(dirname(__FILE__)."/lib/Mobile_Detect.php");$detect = new Mobile_Detect;$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');if($_SERVER["SERVER_NAME"] == "nj.xxx.cn" ){ if($deviceType == "phone") { header("Location:http://m.xxx.cn/"); exit(); }}
Have judged移动设备
What to do with the phone endpoint 使用电脑版
Reply content:
require(dirname(__FILE__)."/lib/Mobile_Detect.php");$detect = new Mobile_Detect;$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');if($_SERVER["SERVER_NAME"] == "nj.xxx.cn" ){ if($deviceType == "phone") { header("Location:http://m.xxx.cn/"); exit(); }}
Have judged移动设备
What to do with the phone endpoint 使用电脑版
Write a session or cookie, record that the customer has clicked on the computer version, and then add the session judgment to the location of the mobile device.