函数名称:quoted_printable_decode() 函数
适用版本:PHP 4, PHP 5, PHP 7
函数描述:该函数用于解码 quoted-printable 编码的字符串。
用法: quoted_printable_decode(string $str): string
参数:
- $str:要解码的 quoted-printable 编码字符串。
返回值: 解码后的字符串。
示例:
<?php
$str = "=E6=88=91=E6=98=AF=E4=B8=80=E4=B8=AA=E6=B5=8B=E8=AF=95=E7=9A=84=20=71=75=6F=74=65=64=5F=70=72=69=6E=74=61=62=6C=65=5F=64=65=63=6F=64=65=28=29=20=E5=87=BD=E6=95=B0=E3=80=82";
$decoded_str = quoted_printable_decode($str);
echo $decoded_str;
?>
输出结果:
我是一个测试的 quoted_printable_decode() 函数。
解释: 在示例中,我们有一个 quoted-printable 编码的字符串,通过调用 quoted_printable_decode() 函数对其进行解码。解码后的结果是原始字符串 "我是一个测试的 quoted_printable_decode() 函数。"。