获取手机型号设备名称


public function getPhoneType() {
        $ua = $this->getUA();
        if($ua!=false) {
            $str = explode(" ",$ua);
            echo '
';print_r($str[3]); 
  
        }
        else {
            Return false;

        }


 public function getUA() {
        if (isset($_SERVER['HTTP_USER_AGENT'])) {
            return $_SERVER['HTTP_USER_AGENT'];
        }
        else {
            return false;
        }

    }



你可能感兴趣的:(php随记,php扩展)