CI_User_agent::accept_charset()

accept_charset([$charset = 'utf-8'])

Parameters:
  • $charset (string) – Character set
Returns:

TRUE if the character set is accepted, FALSE if not

Return type:

bool

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

if ($this->agent->accept_charset('utf-8'))
{
        echo 'You browser supports UTF-8!';
}

Note

This method is not typically very reliable since some browsers do not provide character-set 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.