private function _encodeHeader($val)
    {
        if (is_array($val)) {
            return join(', ', array_map(array($this, '_encodeHeader'), $val));
        }
        // if name matched encode Base64
        if (preg_match("/(.*)<(.*)>/", $val, $match)) {
            return '=?' . $this->_charset . '?B?' . base64_encode($match[1]) . '?= <' . $match[2] . '>';
        }
        return $val;
    }
private function _encodeHeader($val)
    {
        if (is_array($val)) {
            return join(', ', array_map(array($this, '_encodeHeader'), $val));
        }
        // if name matched encode Base64
        if (preg_match("/(.*)<(.*)>/", $val, $match)) {
            return '=?' . $this->_charset . '?B?' . base64_encode($match[1]) . '?= <' . $match[2] . '>';
        }
        return $val;
    }
private function _encodeHeader ( $ val ) { if ( is_array ( $ val ) ) { return join ( ', ' , array_map ( array ( $ this , '_encodeHeader' ) , $ val ) ) ; } // if name matched encode Base64 if ( preg_match ( "/(.*)<(.*)>/" , $ val , $ match ) ) { return '=?' . $ this -> _charset . '?B?' . base64_encode ( $ match [ 1 ] ) . '?= <' . $ match [ 2 ] . '>' ; } return $ val ; }
Encode header field body, and return it.

@param string $val Header Field(s) body.

@return string
Encode header field body and return it .