//mobile  false pc   true no pc
    function is_mobile(){
        $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
        $is_pc = (strpos($agent, 'windows nt')) ? true : false;
        $is_mac = (strpos($agent, 'mac os')) ? true : false;
        /* $is_linux =    (strpos($agent, 'linux')) ? true : false;
        $is_unix =    (strpos($agent, 'unix')) ? true : false;
         */
        $is_iphone = (strpos($agent, 'iphone')) ? true : false;
        $is_android = (strpos($agent, 'android')) ? true : false;
        $is_ipad = (strpos($agent, 'ipad')) ? true : false;

if($is_pc){
              return  false;
        }
        
        if($is_mac){
              return  true;
        }
        
        /* if($is_linux){
              return  false;
        }
        
        if($is_unix){
              return  false;
        } */
        
        if($is_iphone){
              return  true;
        }
        
        if($is_android){
              return  true;
        }
        
        if($is_ipad){
              return  true;
        }
    }
    
    function infoAgent(){
        $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
        return $agent;
    }
    
    function is_iphone(){
        $info = false;
        if(strpos(tecrm::infoAgent(), 'iphone')){
            $info = "iphone";
        }
        return $info;
    }
    
    function is_android(){
        $info = false;
        if(strpos(tecrm::infoAgent(), 'android')){
            $info = "android";
        }
        return $info;
    }
    
    function is_ipad(){
        $info = false;
        if(strpos(tecrm::infoAgent(), 'ipad')){
            $info = "ipad";
        }
        return $info;
    }

最新文章

  1. iOS - Push 通知推送
  2. EF架构~关于多对多关系表无法更新与插入的问题
  3. javascript数组浅谈2
  4. C语言 小游戏之贪吃蛇
  5. linux下查阅文件内容cat,more,less,tail
  6. centos7 高速安装 mariadb(mysql)
  7. SQL的JOIN语法解析(inner join, left join, right join, full outer join的区别)
  8. MongoDB的备份和部署 高级功能索引,聚合复制,分片
  9. Java基础笔记(1)----语言基础
  10. Android ADB命令 adb devices 出现error:protocol fault (no status)
  11. MySQL的SQL语句
  12. [work]Spring_Jdbc
  13. 数组初始化 memset fill
  14. Hibernate入门步骤及概念
  15. 程序移植到AUTOCAD2013笔记
  16. 你的跑步姿势正确吗? 教你正确跑步姿势 & 常识
  17. 作业 20181030-3互评Alpha版本
  18. PHP用抛物线的模型实现微信红包生成算法的程序源码
  19. hdu 3729 I'm Telling the Truth(二分匹配_ 匈牙利算法)
  20. 【BZOJ 2711】 2711: [Violet 2]After 17 (0-1 背包)

热门文章

  1. 15 [网络编程]-ssh远程命令
  2. P2167 [SDOI2009]Bill的挑战
  3. pycharm如何显示工具栏
  4. CSS快速入门-定位(position)
  5. JetBrains全家桶使用攻略
  6. Linux之linux基础命令2
  7. tpshop购物网站价格筛选功能的测试用例设计
  8. php的id加密
  9. tomcat 在liunx中shutdown后进程仍然存在的两种实用解决办法
  10. variadic templates & pass by const reference & member operator [] in const map & gcc sucks