2015-12-15 32 views
0

我需要從一個電子郵件用奇怪的字符imap_fetchbody HTML

代碼

$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= 
... 
+1

它被引用 - 可打印:https://en.wikipedia.org/wiki/Quoted-printable。通常是通過「愚蠢的」郵件客戶端傳遞的信號。 '= 3d'是一個文字'='的表示方式。 3d hex = 61 ascii =「等號」。 –

+0

@MarcB創建答案:) – clarkk

回答

0

這是quoted-printable文本,通過了「啞巴」的郵件客戶端的可能結果。 =用於編碼/轉義不可打印/元字符,非常類似於HTML中使用的&...;

=3d=的引用可打印表示:3d十六進制= 61 ASCII = equals sign