Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imap_mime_header_decode(3) [php man page]

IMAP_MIME_HEADER_DECODE(3)						 1						IMAP_MIME_HEADER_DECODE(3)

imap_mime_header_decode - Decode MIME header elements

SYNOPSIS
array imap_mime_header_decode (string $text) DESCRIPTION
Decodes MIME message header extensions that are non ASCII text (see RFC2047). PARAMETERS
o $text - The MIME text RETURN VALUES
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. EXAMPLES
Example #1 imap_mime_header_decode(3) 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} "; } ?> The above example will output: Charset: ISO-8859-1 Text: Keld Jorn 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. SEE ALSO
imap_utf8(3). PHP Documentation Group IMAP_MIME_HEADER_DECODE(3)

Check Out this Related Man Page

ICONV_MIME_DECODE(3)							 1						      ICONV_MIME_DECODE(3)

iconv_mime_decode - Decodes a MIMEheader field

SYNOPSIS
string iconv_mime_decode (string $encoded_header, [int $mode], [string $charset = ini_get("iconv.internal_encoding")]) DESCRIPTION
Decodes a MIME header field. PARAMETERS
o $encoded_header - The encoded header, as a string. o $mode -$mode determines the behaviour in the event iconv_mime_decode(3) encounters a malformed MIME header field. You can specify any combination of the following bitmasks. Bitmasks acceptable to iconv_mime_decode(3) +------+--------------------------------------+---+ |Value | | | | | | | | | Constant | | | | | | | | Description | | | | | | +------+--------------------------------------+---+ | 1 | | | | | | | | | ICONV_MIME_DECODE_STRICT | | | | | | | | If set, the given header is decoded | | | | in full conformance with the stan- | | | | dards defined in RFC2047. This | | | | option is disabled by default | | | | because there are a lot of broken | | | | mail user agents that don't follow | | | | the specification and don't produce | | | | correct MIME headers. | | | | | | | 2 | | | | | | | | | ICONV_MIME_DECODE_CONTINUE_ON_ERROR | | | | | | | | If set, iconv_mime_decode_head- | | | | ers(3) attempts to ignore any gram- | | | | matical errors and continue to | | | | process a given header. | | | | | | +------+--------------------------------------+---+ o $charset - The optional $charset parameter specifies the character set to represent the result by. If omitted, iconv.internal_encoding will be used. RETURN VALUES
Returns a decoded MIME field on success, or FALSE if an error occurs during the decoding. EXAMPLES
Example #1 iconv_mime_decode(3) example <?php // This yields "Subject: Prufung Prufung" echo iconv_mime_decode("Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=", 0, "ISO-8859-1"); ?> SEE ALSO
iconv_mime_decode_headers(3), mb_decode_mimeheader(3), imap_mime_header_decode(3), imap_base64(3), imap_qprint(3). PHP Documentation Group ICONV_MIME_DECODE(3)
Man Page