顺德公农庄 发表于 2018-12-13 07:19:32

PHP 扫码识别信息

public function order_source()
   {
      $useragent= strtolower($_SERVER["HTTP_USER_AGENT"]);
      // 微信
      $is_weixin= strripos($useragent,'micromessenger');
      if($is_weixin){
            //echo '微信';exit;
            echo ' window.location.href="https://www.xxx.com"; ';
            exit;
      }
      // iphone
      $is_iphone= strripos($useragent,'iphone');
      if($is_iphone){
            $this->display("Codes/ios");
            echo ' window.location.href="https://www.xxx.com"; ';
            exit;
      }
      // android
      $is_android    = strripos($useragent,'android');
      if($is_android){
            $this->display("Codes/android");
            echo ' window.location.href="https://www.xxx.com"; ';
            exit;
      }   
      // ipad
      $is_ipad    = strripos($useragent,'ipad');
      if($is_ipad){
            echo 'ipad';exit;
      }
      // ipod
      $is_ipod    = strripos($useragent,'ipod');
      if($is_ipod){
            echo 'ipod';exit;
      }
      // pc电脑
      $is_pc = strripos($useragent,'windows nt');
      if($is_pc){
            echo 'pc';exit;
      }
      echo 'other';
    }


页: [1]
查看完整版本: PHP 扫码识别信息