duanji8887 2015-03-11 23:21
浏览 14
已采纳

PHP如何从多行中删除= 20

I am wondering if it is possible to remove only =20 from the end of multiple lines within a block of text? This is for my e-mail to ticket gateway. When a reply is received and contains multiple "=20" I want to remove them. However I want to leave =20 intact if it is legitimately part an e-mail (such as a URL). An example of an incoming e-mail:

$correspondence = <<<EOF
Hello=20
=20
Thank you for getting back to me.=20
The link you need is http://domain.com/index.php?id=204726 .=20
Regards=20
EOF;
  • 写回答

2条回答 默认 最新

  • dsapkqaduj6718493 2015-03-11 23:28
    关注

    This is quoted-printable encoding, which uses = followed by hex codes to encode special characters in plain text. Use quoted_printable_decode to decode a message that's encoded this way. You shouldn't have to worry about literal =20 anywhere in the text, because it should be encoded as =3D20 (=3D is the encoding for the = sign), and you'll get back the original =20 when it's decoded.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?