Prado\I18N\core\HTTPNegotiator::getCharsets PHP 메소드

getCharsets() 공개 메소드

Get a list of charsets acceptable by the client browser.
public getCharsets ( ) : array
리턴 array list of charsets in preferable order.
    function getCharsets()
    {
        if ($this->charsets !== null) {
            return $this->charsets;
        }
        $this->charsets = array();
        if (!isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
            return $this->charsets;
        }
        foreach (explode(',', $_SERVER['HTTP_ACCEPT_CHARSET']) as $charset) {
            if (!empty($charset)) {
                $this->charsets[] = preg_replace('/;.*/', '', $charset);
            }
        }
        return $this->charsets;
    }