<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.imap.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.imap-savebody.php',
    1 => 'imap_savebody',
    2 => 'Save a specific body section to a file',
  ),
  'up' => 
  array (
    0 => 'ref.imap.php',
    1 => 'IMAP 函数',
  ),
  'prev' => 
  array (
    0 => 'function.imap-rfc822-write-address.php',
    1 => 'imap_rfc822_write_address',
  ),
  'next' => 
  array (
    0 => 'function.imap-scan.php',
    1 => 'imap_scan',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/imap/functions/imap-savebody.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imap-savebody" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_savebody</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_savebody</span> &mdash; <span class="dc-title">Save a specific body section to a file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-savebody-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_savebody</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.imap-connection.php" class="type IMAP\Connection">IMAP\Connection</a></span> <code class="parameter">$imap</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$file</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$message_num</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$section</code><span class="initializer"> = &quot;&quot;</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Saves a part or the whole body of the specified message. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-savebody-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">imap</code></dt><dd><p class="para"><span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span> 实例。</p></dd>
    
     <dt><code class="parameter">file</code></dt>
     <dd>
      <p class="para">
       The path to the saved file as a string, or a valid file descriptor
       returned by <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">message_num</code></dt>
     <dd>
      <p class="para">
       The message number
      </p>
     </dd>
    
    
     <dt><code class="parameter">section</code></dt>
     <dd>
      <p class="para">
       The part number. It is a string of integers delimited by period which
       index into a body part list as per the IMAP4 specification
      </p>
     </dd>
    
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       A bitmask with one or more of the following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.ft-uid">FT_UID</a></code></strong> - The <code class="parameter">message_num</code> is a UID
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.ft-peek">FT_PEEK</a></code></strong> - Do not set the \Seen flag if
          not already set
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.ft-internal">FT_INTERNAL</a></code></strong> - The return string is in
          internal format, will not canonicalize to CRLF.
         </span>
        </li>
       </ul>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-savebody-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-savebody-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  现在 <code class="parameter">imap</code> 参数接受 <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>
  实例，之前接受有效的 <code class="literal">imap</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>。
 </td>
</tr>

    </tbody>
   
  </table>

 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.imap-savebody-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.imap-fetchbody.php" class="function" rel="rdfs-seeAlso">imap_fetchbody()</a> - Fetch a particular section of the body of the message</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>