【函数功能】
该函数把quoted_printable_encode函数加密过的字符串解码为 8 位 ASCII 字符串。
【函数语法】
quoted_printable_decode ($str)
【参数说明】
$str:必需,要解码的 quoted-printable 字符串。
【演示程序】
<?php
/**
* quoted_printable_decode ($str)
* **/
$str = "hello world,i am PHP!大家好,我是PHP!";
$encode_str = quoted_printable_encode($str);
echo $encode_str;
echo '<br>';
echo quoted_printable_decode($encode_str);
?>
【输出结果】
hello world,i am PHP!=E5=A4=A7=E5=AE=B6=E5=A5=BD=EF=BC=8C=E6=88=91=E6=98= =AFPHP=EF=BC=81
hello world,i am PHP!大家好,我是PHP!
【特别注意】
1.经过 quoted-printable 编码后的数据与通过邮件传输进行修改的不一样。完全 US-ASCII 的文本可进行 quoted-printable 编码,以确保通过文字翻译或线包网关进行消息传递时数据的完整性。
2.该函数一般用于解码quoted_printable_encode()函数编码的字符串。
【原版定义】
/**
* Convert a quoted-printable string to an 8 bit string
* @link http://www.php.net/manual/en/function.quoted-printable-decode.php
* @param str string <p>
* The input string.
* </p>
* @return string the 8-bit binary string.
*/
转载请注明出处:php1234.cn ,原文地址:http://www.php1234.cn/a/functions/2016/1026/108.html