文字

imap_header

(PHP 4, PHP 5, PHP 7)

imap_header别名 imap_headerinfo()

说明

此函数是该函数的别名: imap_headerinfo() .

用户评论:

[#1] stepotronic at nimbleminds dot net [2008-02-05 11:43:03]

At jeremy at caramiel dot com:
You are wrong, since it will just work if the encoding of the characters is also used in the current context.
There is a reason why it comes with the charset :)

There are way better solutions with imap_mime_header_decode

[#2] jeremy at caramiel dot com [2008-02-01 06:37:53]

Here is a clean way to decode encoded imap headers that will work in all cases :

function fix_text($str)
{
$subject = '';
$subject_array = imap_mime_header_decode($str);

foreach ($subject_array AS $obj)
$subject .= rtrim($obj->text, "\t");

return $subject;
}

上一篇: 下一篇: