📄 function.iconv-mime-decode.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Decodes a MIME header field</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.iconv-mime-decode-headers.html">iconv_mime_decode_headers</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.iconv-mime-encode.html">iconv_mime_encode</a></div> <div class="up"><a href="ref.iconv.html">iconv Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.iconv-mime-decode" class="refentry"> <div class="refnamediv"> <h1 class="refname">iconv_mime_decode</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">iconv_mime_decode</span> — <span class="dc-title">Decodes a <i>MIME</i> header field</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><b><b>iconv_mime_decode</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$encoded_header</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$mode</tt></span> [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$charset</tt></span> ]] )</div> <p class="para rdfs-comment"> Decodes a <i>MIME</i> header field. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">encoded_header</tt></i></span> <dd> <p class="para"> The encoded header, as a string. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">mode</tt></i></span> <dd> <p class="para"> <i><tt class="parameter">mode</tt></i> determines the behaviour in the event <b>iconv_mime_decode()</b> encounters a malformed <i>MIME</i> header field. You can specify any combination of the following bitmasks. <table border="5"> <caption><b>Bitmasks acceptable to <b>iconv_mime_decode()</b></b></caption> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Value</th> <th colspan="1">Constant</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">1</td> <td colspan="1" rowspan="1" align="left">ICONV_MIME_DECODE_STRICT</td> <td colspan="1" rowspan="1" align="left"> If set, the given header is decoded in full conformance with the standards defined in <a href="http://www.faqs.org/rfcs/rfc2047" class="link external">» RFC2047</a>. 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 <i>MIME</i> headers. </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">2</td> <td colspan="1" rowspan="1" align="left">ICONV_MIME_DECODE_CONTINUE_ON_ERROR</td> <td colspan="1" rowspan="1" align="left"> If set, <a href="function.iconv-mime-decode-headers.html" class="function">iconv_mime_decode_headers()</a> attempts to ignore any grammatical errors and continue to process a given header. </td> </tr> </tbody> </colgroup> </table> </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">charset</tt></i></span> <dd> <p class="para"> The optional <i><tt class="parameter">charset</tt></i> parameter specifies the character set to represent the result by. If omitted, <a href="iconv.configuration.html" class="link">iconv.internal_encoding</a> will be used. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a decoded <i>MIME</i> field on success, or <b><tt>FALSE</tt></b> if an error occurs during the decoding. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 <b>iconv_mime_decode()</b> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// This yields "Subject: Pr眉fung Pr眉fung"<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">iconv_mime_decode</span><span style="color: #007700">(</span><span style="color: #DD0000">"Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?="</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #DD0000">"ISO-8859-1"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.iconv-mime-decode-headers.html" class="function" rel="rdfs-seeAlso">iconv_mime_decode_headers()</a></li> <li class="member"><a href="function.mb-decode-mimeheader.html" class="function" rel="rdfs-seeAlso">mb_decode_mimeheader()</a></li> <li class="member"><a href="function.imap-mime-header-decode.html" class="function" rel="rdfs-seeAlso">imap_mime_header_decode()</a></li> <li class="member"><a href="function.imap-base64.html" class="function" rel="rdfs-seeAlso">imap_base64()</a></li> <li class="member"><a href="function.imap-qprint.html" class="function" rel="rdfs-seeAlso">imap_qprint()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.iconv-mime-decode-headers.html">iconv_mime_decode_headers</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.iconv-mime-encode.html">iconv_mime_encode</a></div> <div class="up"><a href="ref.iconv.html">iconv Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -