PHP的使用过程中,我们可能需要将 8-bit
字符串转换成 quoted-printable
字符串,为了解决这一麻烦,我们可以使用quoted_printable_encode()
函数完成这一任务,本文就带大家一起来看一看。
首先,我们来看一看quoted_printable_encode()函数的语法:
quoted_printable_encode ( string $str )
-
str:输入的字符串。
-
返回值:返回编码之后的字符串
代码实例:
<?php $str1="php.cn=2021"; echo $str1."<br>"; $str2=quoted_printable_encode($str1); echo $str2; ?>
输出:php.cn=2021 php.cn=3D2021