codeigniter device

Solutions on MaxInterview for codeigniter device by the best coders in the world

showing results for - "codeigniter device"
Braeden
21 May 2017
1$this->load->library('user_agent');
2
3if ($this->agent->is_browser())
4{
5        $agent = $this->agent->browser().' '.$this->agent->version();
6}
7elseif ($this->agent->is_robot())
8{
9        $agent = $this->agent->robot();
10}
11elseif ($this->agent->is_mobile())
12{
13        $agent = $this->agent->mobile();
14}
15else
16{
17        $agent = 'Unidentified User Agent';
18}
19
20echo $agent;
21
22echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)
23