<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Extracts/decodes a message section</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mailparse-msg-create.html">mailparse_msg_create</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mailparse-msg-extract-part.html">mailparse_msg_extract_part</a></div> <div class="up"><a href="ref.mailparse.html">Mailparse Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.mailparse-msg-extract-part-file" class="refentry"> <div class="refnamediv"> <h1 class="refname">mailparse_msg_extract_part_file</h1> <p class="verinfo">(PECL mailparse >= 0.9.0)</p><p class="refpurpose"><span class="refname">mailparse_msg_extract_part_file</span> — <span class="dc-title">Extracts/decodes a message section</span></p> </div> <div class="refsect1 description" id="refsect1-function.mailparse-msg-extract-part-file-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><strong>mailparse_msg_extract_part_file</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$mimemail</code></span> , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$filename</code></span> [, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callbackfunc</code></span> ] )</div> <p class="para rdfs-comment"> Extracts/decodes a message section from the supplied filename. </p> <p class="para"> The contents of the section will be decoded according to their transfer encoding - base64, quoted-printable and uuencoded text are supported. </p> </div> <div class="refsect1 parameters" id="refsect1-function.mailparse-msg-extract-part-file-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">mimemail</code></em></span> <dd> <p class="para"> A valid <em>MIME</em> resource, created with <span class="function"><a href="function.mailparse-msg-create.html" class="function">mailparse_msg_create()</a></span>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">filename</code></em></span> <dd> <p class="para"> Can be a file name or a valid stream resource. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">callbackfunc</code></em></span> <dd> <p class="para"> If set, this must be either a valid callback that will be passed the extracted section, or <strong><code>NULL</code></strong> to make this function return the extracted section. </p> <p class="para"> If not specified, the contents will be sent to "stdout". </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.mailparse-msg-extract-part-file-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> If <em><code class="parameter">callbackfunc</code></em> is not <strong><code>NULL</code></strong> returns <strong><code>TRUE</code></strong> on success. </p> <p class="para"> If <em><code class="parameter">callbackfunc</code></em> is set to <strong><code>NULL</code></strong>, returns the extracted section as a string. </p> <p class="para"> Returns <strong><code>FALSE</code></strong> on error. </p> </div> <div class="refsect1 seealso" id="refsect1-function.mailparse-msg-extract-part-file-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.mailparse-msg-extract-part.html" class="function" rel="rdfs-seeAlso">mailparse_msg_extract_part()</a> - Extracts/decodes a message section</span></li> <li class="member"> <span class="function"><a href="function.mailparse-msg-extract-whole-part-file.html" class="function" rel="rdfs-seeAlso">mailparse_msg_extract_whole_part_file()</a> - Extracts a message section including headers without decoding the transfer encoding</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mailparse-msg-create.html">mailparse_msg_create</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mailparse-msg-extract-part.html">mailparse_msg_extract_part</a></div> <div class="up"><a href="ref.mailparse.html">Mailparse Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>