CI_User_agent::is_mobile()

is_mobile([$key = NULL])

Parameters:
  • $key (string) – Optional mobile device name
Returns:

TRUE if the user agent is a (specified) mobile device, FALSE if not

Return type:

bool

Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

if ($this->agent->is_mobile('iphone'))
{
        $this->load->view('iphone/home');
}
elseif ($this->agent->is_mobile())
{
        $this->load->view('mobile/home');
}
else
{
        $this->load->view('web/home');
}
doc_CodeIgniter
2016-10-15 16:32:05
Comments
Leave a Comment

Please login to continue.