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)