有乎-价值、共享、信任

What you care about-value, sharing, trust

微信调起浏览器打开当前网址用于防封或APK下载

| 阅读:2423 发表时间:2019-09-23 20:50:21 微信

场景:微信中的链接用浏览器打开

$user_agent= $_SERVER['HTTP_USER_AGENT'];
if (strpos($user_agent,'MicroMessenger')) {
    $agent= strtolower($_SERVER['HTTP_USER_AGENT']);
    if(strpos($agent,'android')){
      header("Content-type:text/plain; charset=utf-8");
      header('Content-Disposition: form-data; name=file;filename=open.apk');
    }
}

无需多言,代码自己看!

*文章为作者独立观点,不代表【uuuho有乎】的立场
本文由【uuuho有乎】发表并编辑,转载此文章须经作者同意,并请附上出处及本页链接。如有侵权,请联系本站删除。

Who are we?