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
推荐: 《 2021年PHP面试题大汇总(收藏) 》《 php视频教程 》
以上就是如何在PHP中完成quoted-printable字符串转换的详细内容!