downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.iconv-mime-decode.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.iconv.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.iconv-mime-decode.php',
   
1 => 'iconv_mime_decode',
  ),
 
'up' =>
  array (
   
0 => 'ref.iconv.php',
   
1 => 'iconv Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.iconv-mime-decode-headers.php',
   
1 => 'iconv_mime_decode_headers',
  ),
 
'next' =>
  array (
   
0 => 'function.iconv-mime-encode.php',
   
1 => 'iconv_mime_encode',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<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> &mdash; <span class="dc-title">Decodes a <i>MIME</i> header field</span></p>

 </div>
 
 <a name="function.iconv-mime-decode.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><b>iconv_mime_decode</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 class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$charset</tt><span class="initializer"> = ini_set(&quot;iconv.internal_encoding&quot;)</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   Decodes a <i>MIME</i> header field.
  </p>
 </div>


 <a name="function.iconv-mime-decode.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">encoded_header</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The encoded header, as a string.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">mode</tt></i>
</span>

     </dt><dd class="listitem">

      <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.
       </p><table class="doctable table">
        <caption><b>Bitmasks acceptable to <b>iconv_mime_decode()</b></b></caption>
       
         <thead valign="middle">
          <tr valign="middle">
           <th>Value</th>
           <th>Constant</th>
           <th>Description</th>
          </tr>

         </thead>

         <tbody valign="middle" class="tbody">
          <tr valign="middle">
           <td align="left">1</td>
           <td align="left">ICONV_MIME_DECODE_STRICT</td>
           <td 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">&raquo; RFC2047</a>.
            This option is disabled by default because there are a lot of
            broken mail user agents that don&#039;t follow the specification and don&#039;t
            produce correct <i>MIME</i> headers.
           </td>
          </tr>

          <tr valign="middle">
           <td align="left">2</td>
           <td align="left">ICONV_MIME_DECODE_CONTINUE_ON_ERROR</td>
           <td align="left">
            If set, <a href="function.iconv-mime-decode-headers.php" class="function">iconv_mime_decode_headers()</a>
            attempts to ignore any grammatical errors and continue to process
            a given header.
           </td>
          </tr>

         </tbody>
       
       </table>
<p>
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">charset</tt></i>
</span>

     </dt><dd class="listitem">

      <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.php" class="link">iconv.internal_encoding</a>
       will be used.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.iconv-mime-decode.returnvalues"></a><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 class="constant">FALSE</tt></b> if an error occurs during the decoding.
  </p>
 </div>


 <a name="function.iconv-mime-decode.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>iconv_mime_decode()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;This&nbsp;yields&nbsp;"Subject:&nbsp;Prüfung&nbsp;Prüfung"<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">iconv_mime_decode</span><span style="color: #007700">(</span><span style="color: #DD0000">"Subject:&nbsp;=?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?="</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ISO-8859-1"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div><p>
  </p>
 </div>


 <a name="function.iconv-mime-decode.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.iconv-mime-decode-headers.php" class="function" rel="rdfs-seeAlso">iconv_mime_decode_headers()</a> - Decodes multiple MIME header fields at once</li>
    <li class="member"><a href="function.mb-decode-mimeheader.php" class="function" rel="rdfs-seeAlso">mb_decode_mimeheader()</a> - Decode string in MIME header field</li>
    <li class="member"><a href="function.imap-mime-header-decode.php" class="function" rel="rdfs-seeAlso">imap_mime_header_decode()</a> - Decode MIME header elements</li>
    <li class="member"><a href="function.imap-base64.php" class="function" rel="rdfs-seeAlso">imap_base64()</a> - Decode BASE64 encoded text</li>
    <li class="member"><a href="function.imap-qprint.php" class="function" rel="rdfs-seeAlso">imap_qprint()</a> - Convert a quoted-printable string to an 8 bit string</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites