php识别手机浏览网页并跳转到指定页面
发布网友
发布时间:2022-04-06 00:49
我来回答
共1个回答
热心网友
时间:2022-04-06 02:18
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
$uachar = "/(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|pocket|portalmmm|ppc;|smartphone|sonyericsson|sqh|spv|symbian|treo|up.browser|up.link|vodafone|windows ce|xda |xda_)/i";
if($ua == '' || preg_match($uachar, $ua)){
header('/kuaifan.php')
}else{
header('/forum.php')
}