array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.quoted-printable-decode.php', 1 => 'quoted_printable_decode', ), 'up' => array ( 0 => 'ref.strings.php', 1 => '字符串 函数', ), 'prev' => array ( 0 => 'function.printf.php', 1 => 'printf', ), 'next' => array ( 0 => 'function.quoted-printable-encode.php', 1 => 'quoted_printable_encode', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/strings/functions/quoted-printable-decode.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
quoted_printable_decode — 将 quoted-printable 字符串转换为 8-bit 字符串
该函数返回 8 位二进制字符串,对应解码后的带引号可打印的字符串(参考 » RFC2045 的 6.7 章节,而不是 » RFC2821 的 4.5.2 章节,因此不会去除行首的附加句号)。
该函数与 imap_qprint() 函数十分相似,但是该函数不需要依赖 IMAP 模块。
string
输入的字符串。
返回的 8-bit 二进制字符串。
示例 #1 quoted_printable_decode() 示例
<?php
$encoded = quoted_printable_encode('Möchten Sie ein paar Äpfel?');
var_dump($encoded);
var_dump(quoted_printable_decode($encoded));
?>
以上示例会输出:
string(37) "M=C3=B6chten Sie ein paar =C3=84pfel?" string(29) "Möchten Sie ein paar Äpfel?"