<?php
// 验证设备为PC还是WAP
$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"))
{
// 走到这里即为手机端,可跳转到手机端页面
$url = 'http://手机端网址'.$_SERVER['REQUEST_URI'];
header("Location:".$url); // 重定向页面
exit;
}