首页 >函数列表 >imap_mime_header_decode

imap_mime_header_decode

imap_mime_header_decode

(PHP 4, PHP 5)

imap_mime_header_decodeDecode MIME header elements

说明

array imap_mime_header_decode ( string $text )

Decodes MIME message header extensions that are non ASCII text (see » RFC2047).

参数

text

The MIME text

返回值

The decoded elements are returned in an array of objects, where each object has two properties, charset and text.

If the element hasn't been encoded, and in other words is in plain US-ASCII, the charset property of that element is set to default.

范例

Example #1 imap_mime_header_decode() example

<?php
$text 
"=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@example.com>";

$elements imap_mime_header_decode($text);
for (
$i=0$i<count($elements); $i++) {
    echo 
"Charset: {$elements[$i]->charset} ";
    echo 
"Text: {$elements[$i]->text} ";
}
?>

以上例程会输出:

Charset: ISO-8859-1
Text: Keld Jørn Simonsen

Charset: default
Text:  <keld@example.com>

In the above example we would have two elements, whereas the first element had previously been encoded with ISO-8859-1, and the second element would be plain US-ASCII.

参见


  • imap_8bit
  • imap_alerts
  • imap_append
  • imap_base64
  • imap_binary
  • imap_body
  • imap_bodystruct
  • imap_check
  • imap_clearflag_full
  • imap_close
  • imap_create
  • imap_createmailbox
  • imap_delete
  • imap_deletemailbox
  • imap_errors
  • imap_expunge
  • imap_fetchbody
  • imap_fetchheader
  • imap_fetchmime
  • imap_fetchstructure
  • imap_fetchtext
  • imap_fetch_overview
  • imap_gc
  • imap_getacl
  • imap_getmailboxes
  • imap_getsubscribed
  • imap_get_quota
  • imap_get_quotaroot
  • imap_header
  • imap_headerinfo
  • imap_headers
  • imap_last_error
  • imap_list
  • imap_listmailbox
  • imap_listscan
  • imap_listsubscribed
  • imap_lsub
  • imap_mail
  • imap_mailboxmsginfo
  • imap_mail_compose
  • imap_mail_copy
  • imap_mail_move
  • imap_mime_header_decode
  • imap_msgno
  • imap_num_msg
  • imap_num_recent
  • imap_open
  • imap_ping
  • imap_qprint
  • imap_rename
  • imap_renamemailbox
  • imap_reopen
  • imap_rfc822_parse_adrlist
  • imap_rfc822_parse_headers
  • imap_rfc822_write_address
  • imap_savebody
  • imap_scan
  • imap_scanmailbox
  • imap_search
  • imap_setacl
  • imap_setflag_full
  • imap_set_quota
  • imap_sort
  • imap_status
  • imap_subscribe
  • imap_thread
  • imap_timeout
  • imap_uid
  • imap_undelete
  • imap_unsubscribe
  • imap_utf7_decode
  • imap_utf7_encode
  • imap_utf8
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道