当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Mime::encodeQuotedPrintable方法代码示例

本文整理汇总了PHP中Zend_Mime::encodeQuotedPrintable方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Mime::encodeQuotedPrintable方法的具体用法?PHP Zend_Mime::encodeQuotedPrintable怎么用?PHP Zend_Mime::encodeQuotedPrintable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Mime的用法示例。


在下文中一共展示了Zend_Mime::encodeQuotedPrintable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _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)) {
         return $value;
     } else {
         $quotedValue = Zend_Mime::encodeQuotedPrintable($value, 400);
         $quotedValue = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $quotedValue);
         return '=?' . $this->_charset . '?Q?' . $quotedValue . '?=';
     }
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:19,代码来源:Mail.php

示例2: testQP

    public function testQP()
    {
        $text = "This is a cool Test Text with special chars: дцья\n"
              . "and with multiple linesдцья some of the Lines are long, long"
              . ", long, long, long, long, long, long, long, long, long, long"
              . ", long, long, long, long, long, long, long, long, long, long"
              . ", long, long, long, long, long, long, long, long, long, long"
              . ", long, long, long, long and with дцья";

        $qp = Zend_Mime::encodeQuotedPrintable($text);
        $this->assertEquals(quoted_printable_decode($qp), $text);
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:MimeTest.php

示例3: _encodeHeader

 protected function _encodeHeader($value)
 {
     if (Zend_Mime::isPrintable($value)) {
         return $value;
     } else {
         $quotedValue = Zend_Mime::encodeQuotedPrintable($value);
         $quotedValue = str_replace(array('?', ' '), array('=3F', '=20'), $quotedValue);
         $quotedValue = rawurlencode($quotedValue);
         $quotedValue = str_replace('%3D%0A', '', $quotedValue);
         $quotedValue = rawurldecode($quotedValue);
         $quotedValue = '=?' . $this->_charset . '?Q?' . $quotedValue . '?=';
     }
     return $quotedValue;
 }
开发者ID:rdallasgray,项目名称:bbx,代码行数:14,代码来源:Mail.php

示例4: encodeXdfnVariable

 /**
  * @param mixed $variableName
  * @param mixed $variableValue
  * @return string
  */
 protected function encodeXdfnVariable($variableName, $variableValue)
 {
     if ($this->isReservedVariable($variableName)) {
         $variableName = '*' . $variableName;
         //reserved variables are prefixed
     }
     if ($variableName == '*parts') {
         $encoded = sprintf('%s=%s', $variableName, $variableValue);
     } else {
         $variableValue = addslashes($variableValue);
         $variableValue = Zend_Mime::encodeQuotedPrintable($variableValue, 4096);
         $variableValue = str_replace("\r", "", $variableValue);
         $variableValue = str_replace("\n", " ", $variableValue);
         $encoded = sprintf('%s="%s"', $variableName, $variableValue);
     }
     return $encoded;
 }
开发者ID:Antevenio,项目名称:PowerMta,代码行数:22,代码来源:Transport.php

示例5: _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)) {
         return $value;
     } elseif ($this->_encodingOfHeaders === Zend_Mime::ENCODING_QUOTEDPRINTABLE) {
         $quotedValue = Zend_Mime::encodeQuotedPrintable($value);
         $quotedValue = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $quotedValue);
         return '=?' . $this->_charset . '?Q?' . $quotedValue . '?=';
     } elseif ($this->_encodingOfHeaders === Zend_Mime::ENCODING_BASE64) {
         return '=?' . $this->_charset . '?B?' . Zend_Mime::encodeBase64($value) . '?=';
     } else {
         /**
          * @todo 7Bit and 8Bit is currently handled the same way.
          */
         return $value;
     }
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:26,代码来源:Mail.php

示例6: Zend_Http_Client

$client = new Zend_Http_Client("http://de.wikipedia.org/w/index.php?title=PHP&printable=yes");
$string = $client->request()->getBody();
echo "===================================================================\n";
echo "RUNNING BENCHMARK\n";
echo "===================================================================\n";
echo "Starting encoding with imap_8bit() (" . LOOPS . " times)\n";
$startTime = microtime(true);
for ($i = 0; $i < LOOPS; $i++) {
    imap_8bit($string);
}
$durationImap_8bit = microtime(true) - $startTime;
echo "Duration: " . round($durationImap_8bit, 4) . " seconds\n\n";
echo "Starting encoding with Zend_Mime::encodeQuotedPrintable() (" . LOOPS . " times)\n";
$startTime = microtime(true);
for ($i = 0; $i < LOOPS; $i++) {
    Zend_Mime::encodeQuotedPrintable($string, Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
}
$durationZendMime = microtime(true) - $startTime;
echo "Duration: " . round($durationZendMime, 4) . " seconds\n\n";
echo "Starting encoding with quoted_printable_encode() (" . LOOPS . " times)\n";
$startTime = microtime(true);
for ($i = 0; $i < LOOPS; $i++) {
    quoted_printable_encode($string);
}
$durationQPE = microtime(true) - $startTime;
echo "Duration: " . round($durationQPE, 4) . " seconds\n\n";
echo "===================================================================\n";
echo "SUMMARY\n";
echo "===================================================================\n";
echo "imap_8bit() is " . round($durationZendMime - $durationImap_8bit, 4) . " seconds faster than Zend_Mime!\n";
echo "It is " . round($durationZendMime / $durationImap_8bit, 2) . " times faster\n\n";
开发者ID:Tony133,项目名称:zf-web,代码行数:31,代码来源:benchmark.php


注:本文中的Zend_Mime::encodeQuotedPrintable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。