<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >iconv_mime_decode</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="iconv Functions" HREF="ref.iconv.html"><LINK REL="PREVIOUS" TITLE="iconv_mime_decode_headers" HREF="function.iconv-mime-decode-headers.html"><LINK REL="NEXT" TITLE="iconv_mime_encode" HREF="function.iconv-mime-encode.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.iconv-mime-decode-headers.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.iconv-mime-encode.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.iconv-mime-decode" ></A >iconv_mime_decode</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN84513" ></A ><P > (PHP 5)</P >iconv_mime_decode -- Decodes a <TT CLASS="literal" >MIME</TT > header field</DIV ><DIV CLASS="refsect1" ><A NAME="AEN84517" ></A ><H2 >说明</H2 >string <B CLASS="methodname" >iconv_mime_decode</B > ( string encoded_header [, int mode [, string charset]] )<BR ></BR ><P > Decodes a <TT CLASS="literal" >MIME</TT > header field. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN84533" ></A ><H2 >参数</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >encoded_header</CODE ></DT ><DD ><P > The encoded header, as a string. </P ></DD ><DT ><CODE CLASS="parameter" >mode</CODE ></DT ><DD ><P > <CODE CLASS="parameter" >mode</CODE > determines the behaviour in the event <B CLASS="function" >iconv_mime_decode()</B > encounters a malformed <TT CLASS="literal" >MIME</TT > header field. You can specify any combination of the following bitmasks. <DIV CLASS="table" ><A NAME="AEN84550" ></A ><P ><B >表 1. Bitmasks acceptable to <B CLASS="function" >iconv_mime_decode()</B ></B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><THEAD ><TR ><TH >Value</TH ><TH >Constant</TH ><TH >Description</TH ></TR ></THEAD ><TBODY ><TR ><TD >1</TD ><TD >ICONV_MIME_DECODE_STRICT</TD ><TD > If set, the given header is decoded in full conformance with the standards defined in <A HREF="http://www.faqs.org/rfcs/rfc2047" TARGET="_top" >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 <TT CLASS="literal" >MIME</TT > headers. </TD ></TR ><TR ><TD >2</TD ><TD >ICONV_MIME_DECODE_CONTINUE_ON_ERROR</TD ><TD > If set, <A HREF="function.iconv-mime-decode-headers.html" ><B CLASS="function" >iconv_mime_decode_headers()</B ></A > attempts to ignore any grammatical errors and continue to process a given header. </TD ></TR ></TBODY ></TABLE ></DIV > </P ></DD ><DT ><CODE CLASS="parameter" >charset</CODE ></DT ><DD ><P > The optional <CODE CLASS="parameter" >charset</CODE > parameter specifies the character set to represent the result by. If omitted, <A HREF="ref.iconv.html#iconv.configuration" >iconv.internal_encoding</A > will be used. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN84578" ></A ><H2 >返回值</H2 ><P > Returns a decoded <TT CLASS="literal" >MIME</TT > field on success, or <TT CLASS="constant" ><B >FALSE</B ></TT > if an error occurs during the decoding. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN84583" ></A ><H2 >范例</H2 ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN84586" ></A ><P ><B >例 1. <B CLASS="function" >iconv_mime_decode()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#FF8000">// This yields "Subject: Prüfung Prüfung"<br /></font><font color="#007700">echo </font><font color="#0000BB">iconv_mime_decode</font><font color="#007700">(</font><font color="#DD0000">"Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?="</font><font color="#007700">,<br /> </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#DD0000">"ISO-8859-1"</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN84590" ></A ><H2 >参见</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.iconv-mime-decode-headers.html" ><B CLASS="function" >iconv_mime_decode_headers()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.mb-decode-mimeheader.html" ><B CLASS="function" >mb_decode_mimeheader()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.imap-mime-header-decode.html" ><B CLASS="function" >imap_mime_header_decode()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.imap-base64.html" ><B CLASS="function" >imap_base64()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.imap-qprint.html" ><B CLASS="function" >imap_qprint()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.iconv-mime-decode-headers.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.iconv-mime-encode.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >iconv_mime_decode_headers</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.iconv.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >iconv_mime_encode</TD ></TR ></TABLE ></DIV ></BODY ></HTML >