码迷,mamicode.com
首页 > 其他好文 > 详细

扫描同一个二维码根据浏览器类型访问不同下载地址

时间:2014-10-15 12:04:50      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   io   os   sp   div   

 1 <?php
 2 
 3 $Agent = $_SERVER[‘HTTP_USER_AGENT‘];
 4     preg_match(‘/android|iphone/i‘,$Agent,$matches);
 5     if (strtolower($matches[0]) == ‘android‘)  {
 6         // echo "安卓";
 7         header("Location: ".$GLOBALS["public_appconfig"]["app"][‘android‘]."‘");
 8     } elseif (strtolower($matches[0]) == ‘iphone‘) {
 9         header("‘Location: ".$GLOBALS["public_appconfig"]["app"][‘ios‘]."‘");
10     }else{
11         //不确定是什么系统或者是pc
12         header("Location: ".$GLOBALS["public_appconfig"]["app"][‘android‘]."‘");
13     }
14    
15
16 ?>

 

扫描同一个二维码根据浏览器类型访问不同下载地址

标签:android   style   blog   http   color   io   os   sp   div   

原文地址:http://www.cnblogs.com/hioop/p/4022750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!