CI_User_agent::accept_lang()

accept_lang([$lang = 'en'])

Parameters:
  • $lang (string) – Language key
Returns:

TRUE if provided language is accepted, FALSE if not

Return type:

bool

Lets you determine if the user agent accepts a particular language. Example:

if ($this->agent->accept_lang('en'))
{
        echo 'You accept English!';
}

Note

This method is not typically very reliable since some browsers do not provide language info, and even among those that do, it is not always accurate.

doc_CodeIgniter
2016-10-15 16:32:04
Comments
Leave a Comment

Please login to continue.