本文整理汇总了PHP中Zend_Mime::encodeBase64Header方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Mime::encodeBase64Header方法的具体用法?PHP Zend_Mime::encodeBase64Header怎么用?PHP Zend_Mime::encodeBase64Header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Mime
的用法示例。
在下文中一共展示了Zend_Mime::encodeBase64Header方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
//$value = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩъыьЭЮЯ';
$value = 'いろはにほへとちりぬるをわかよたれそつねならむ';
echo "<pre>B-1. Zend_Mime::encodeBase64Header:<br>\r\n";
echo Zend_Mime::encodeBase64Header($value, $this->_charset, $this->_len, $this->_feed);
echo "\r\n<br><br>";
echo "Q-1. Zend_Mime::encodeQuotedPrintableHeader:<br>\r\n";
echo Zend_Mime::encodeQuotedPrintableHeader($value, $this->_charset, $this->_len, $this->_feed);
echo "\r\n<br><br>";
mb_internal_encoding($this->_charset);
echo "B-2. Base64 by mb_encode_mimeheader:<br>\r\n";
echo mb_encode_mimeheader($value, $this->_charset, 'B', $this->_feed, $this->_len);
echo "\r\n<br><br>";
echo "Q-2. QuotedPrintable by mb_encode_mimeheader:<br>\r\n";
echo mb_encode_mimeheader($value, $this->_charset, 'Q', $this->_feed, $this->_len);
echo "</pre>\r\n";
}
示例2: _encodeHeader
/**
* Encode header fields
*
* Encodes header content according to RFC1522 if it contains non-printable
* characters.
*
* @param string $value
* @return string
*/
protected function _encodeHeader($value)
{
if (Zend_Mime::isPrintable($value) === false) {
if ($this->getHeaderEncoding() === Zend_Mime::ENCODING_QUOTEDPRINTABLE) {
$value = Zend_Mime::encodeQuotedPrintableHeader($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
} else {
$value = Zend_Mime::encodeBase64Header($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
}
}
return $value;
}
示例3: testEncodeMailHeaderBase64
/**
* @group ZF-1688
* @dataProvider dataTestEncodeMailHeaderBase64
*/
public function testEncodeMailHeaderBase64($str, $charset, $result)
{
$this->assertEquals($result, Zend_Mime::encodeBase64Header($str, $charset));
}