private static function extractCharset(array $contentTypeParts)
    {
        foreach ($contentTypeParts as $part) {
            $elements = explode('=', $part);
            $key = trim(array_shift($elements));
            if (strtolower($key) === 'charset') {
                $value = trim(reset($elements));
                return $value ?: null;
            }
        }
        return null;
    }
private static function extractCharset(array $contentTypeParts)
    {
        foreach ($contentTypeParts as $part) {
            $elements = explode('=', $part);
            $key = trim(array_shift($elements));
            if (strtolower($key) === 'charset') {
                $value = trim(reset($elements));
                return $value ?: null;
            }
        }
        return null;
    }
private static function extractCharset ( array $ contentTypeParts ) { foreach ( $ contentTypeParts as $ part ) { $ elements = explode ( '=' , $ part ) ; $ key = trim ( array_shift ( $ elements ) ) ; if ( strtolower ( $ key ) === 'charset' ) { $ value = trim ( reset ( $ elements ) ) ; return $ value ? : null ; } } return null ; }
Tries to extract charset from pre-parsed part of Content-Type value

@param array $contentTypeParts
@return null|string
Tries to extract charset from pre - parsed part of Content - Type value