让安卓用户跳转出微信

<?php

$userAgent = $_SERVER['HTTP_USER_AGENT']; //获取浏览器信息

if (!strpos($userAgent, 'MicroMessenger')) {

echo '这里是微信外面';
}else if(strpos(strtolower($userAgent), 'android')||strpos($userAgent, 'adr')){

header('Content-type: application/vnd.ms-word;charset=utf-8');
header('Content-Disposition:attachment; filename="/Content/1.docx"');

}else {

echo '这里是苹果';

}
posted @ 2019-11-26 15:56  慶哥  阅读(239)  评论(0编辑  收藏  举报