【问题标题】:imap_fetchbody HTML with strange chars带有奇怪字符的 imap_fetchbody HTML
【发布时间】:2015-12-16 03:20:38
【问题描述】:

我需要从电子邮件中提取正文

代码

$body = imap_fetchbody($this->stream, $this->msgno, $section);

但输出包含一些奇怪的字符。在第一行的第一个 HTML 标记中 <div dir=3D"ltr">.. 为什么是 3D ??

输出

<div dir=3D"ltr"><div class=3D"gmail_quote"><br><table width=3D"100%" cells=
pacing=3D"0" cellpadding=3D"0" style=3D"background:#efefef" align=3D"center=
" height=3D"auto"><tbody><tr><td><table border=3D"0" cellspacing=3D"0" cell=
padding=3D"0" width=3D"700" bgcolor=3D"#efefef" align=3D"center" height=3D"=
68"><tbody><tr height=3D"20"><td width=3D"150">=C2=A0</td><td width=3D"548"=
>=C2=A0</td></tr><tr><td height=3D"32" valign=3D"bottom" width=3D"150"><a h=
ref=3D"http://www.aliexpress.com?tracelog=3Drowan&amp;rowan_id1=3DsellerSen=
dGoodsTimeoutMainToBuyer_en_US_2015-12-07&amp;rowan_msg_id=3D64597127548444=
$75498a4ce9274d1888eebf93621499b6&amp;ck=3Din_edm_other" target=3D"_blank">=
<img style=3D"VERTICAL-ALIGN:bottom" border=3D"0" alt=3D"aliexpress.com" sr=
c=3D"http://gtms01.alicdn.com/tps/i1/TB1RvclHFXXXXaQXpXXxT2CGpXX-160-40.png=
" width=3D"160" height=3D"40"></a></td><td style=3D"COLOR:#ccc" height=3D"3=
2" valign=3D"bottom" width=3D"548" align=3D"right"><a style=3D"PADDING-BOTT=
OM:0px;PADDING-LEFT:4px;PADDING-RIGHT:4px;FONT-FAMILY:arial;COLOR:#666;FONT=
-SIZE:11px;TEXT-DECORATION:none;PADDING-TOP:0px" href=3D"http://trade.aliba=
ba.com/order_list.htm?tracelog=3Drowan&amp;rowan_id1=3DsellerSendGoodsTimeo=
utMainToBuyer_en_US_2015-12-07&amp;rowan_msg_id=3D64597127548444$75498a4ce9=
274d1888eebf93621499b6&amp;ck=3Din_edm_other" target=3D"_blank">My Orders</=
a> | <a style=3D"PADDING-BOTTOM:0px;PADDING-LEFT:4px;PADDING-RIGHT:4px;FONT=
-FAMILY:arial;COLOR:#666;FONT-SIZE:11px;TEXT-DECORATION:none;PADDING-TOP:0p=
x" href=3D"http://www.aliexpress.com/help/home.html#center?tracelog=3Drowan=
&amp;rowan_id1=3DsellerSendGoodsTimeoutMainToBuyer_en_US_2015-12-07&amp;row=
...

【问题讨论】:

  • 引用可打印:en.wikipedia.org/wiki/Quoted-printable。通常是通过“哑”邮件客户端的标志。 =3d 是文字 = 的表示方式。 3d hex = 61 ascii = "等号"。
  • @MarcB 创建一个答案 :)

标签: php email imap


【解决方案1】:

这是quoted-printable 文本,可能是通过“哑”邮件客户端的结果。 = 用于编码/转义不可打印/元字符,就像在 HTML 中使用 &amp;...; 一样。

=3d= 的引用可打印表示:3d hex = 61 ascii = equals sign

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-20
    • 2017-10-03
    • 1970-01-01
    • 2013-09-20
    • 2012-10-15
    • 2010-12-15
    • 2013-01-19
    • 1970-01-01
    相关资源
    最近更新 更多