public function uaByCI(){ $this->load->library('user_agent'); if ($this->agent->is_browser()){ $agent = $this->agent->browser(); }elseif ($this->agent->is_robot()){ $agent = $this->agent->robot(); }elseif ($this->agent->is_mobile()){ $agent = $this->agent->mobile(); }else{ $agent = 'Unidentified User Agent'; } $ver = $this->agent->version(); // echo $agent; return array('agent'=>$agent,"ver"=>$ver); // echo $this->agent->platform(); }
转载于:https://my.oschina.net/u/3268486/blog/2979205