<?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-getsubscribed.php',
    1 => 'imap_getsubscribed',
    2 => 'List all the subscribed mailboxes',
  ),
  'up' => 
  array (
    0 => 'ref.imap.php',
    1 => 'IMAP 函数',
  ),
  'prev' => 
  array (
    0 => 'function.imap-getmailboxes.php',
    1 => 'imap_getmailboxes',
  ),
  'next' => 
  array (
    0 => 'function.imap-header.php',
    1 => 'imap_header',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/imap/functions/imap-getsubscribed.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imap-getsubscribed" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_getsubscribed</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_getsubscribed</span> &mdash; <span class="dc-title">List all the subscribed mailboxes</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-getsubscribed-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_getsubscribed</strong></span>(<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>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$reference</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pattern</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Gets information about the subscribed mailboxes.
  </p>
  <p class="para">
   Identical to <span class="function"><a href="function.imap-getmailboxes.php" class="function">imap_getmailboxes()</a></span>, except that it only
   returns mailboxes that the user is subscribed to.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-getsubscribed-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">reference</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">reference</code> should normally be just the server
       specification as described in <span class="function"><a href="function.imap-open.php" class="function">imap_open()</a></span>
      </p>
      <div class="warning"><strong class="warning">警告</strong><p class="simpara">
Passing untrusted data to this parameter is <em>insecure</em>, unless
<a href="imap.configuration.php#ini.imap.enable-insecure-rsh" class="link">imap.enable_insecure_rsh</a> is disabled.
</p></div>
     </dd>
    
    
     <dt><code class="parameter">pattern</code></dt>
     <dd>
      <p class="para">指定在邮箱层级的何处开始查找。</p>
<p class="para">在组成 <code class="parameter">pattern</code> 的字符中可使用两个特殊字符：
 &#039;<code class="literal">*</code>&#039; 和 &#039;<code class="literal">%</code>&#039;。
 &#039;<code class="literal">*</code>&#039; 是指返回所有邮箱目录. 如果将 &#039;<code class="literal">*</code>&#039; 作为
 <code class="parameter">pattern</code> 参数时, 则会返回整个邮箱层级结构。
 &#039;<code class="literal">%</code>&#039; 是指只返回当前级次。
 &#039;<code class="literal">%</code>&#039; 作为 <code class="parameter">pattern</code> 参数则只会返回顶层邮箱；
 &#039;<code class="literal">~/mail/%</code>&#039; 用于 <code class="literal">UW_IMAPD</code>
 则会返回名为 <var class="filename">~/mail</var> 的目录, 但不包含其子目录。</p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-getsubscribed-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array of objects containing mailbox information. Each
   object has the attributes <code class="parameter">name</code>, specifying
   the full name of the mailbox; <code class="parameter">delimiter</code>,
   which is the hierarchy delimiter for the part of the hierarchy
   this mailbox is in; and
   <code class="parameter">attributes</code>. <code class="parameter">Attributes</code>
   is a bitmask that can be tested against:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-noinferiors">LATT_NOINFERIORS</a></code></strong> - This mailbox has no
      &quot;children&quot; (there are no mailboxes below this one).
     </span>
    </li>
   <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-noselect">LATT_NOSELECT</a></code></strong> - This is only a container,
      not a mailbox - you cannot open it.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-marked">LATT_MARKED</a></code></strong> - This mailbox is marked.
      Only used by UW-IMAPD.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-unmarked">LATT_UNMARKED</a></code></strong> - This mailbox is not marked.
      Only used by UW-IMAPD.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-referral">LATT_REFERRAL</a></code></strong> - This container has a referral to a remote mailbox.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-haschildren">LATT_HASCHILDREN</a></code></strong> - This mailbox has selectable inferiors.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <strong><code><a href="imap.constants.php#constant.latt-hasnochildren">LATT_HASNOCHILDREN</a></code></strong> - This mailbox has no selectable inferiors.
     </span>
    </li>
   </ul>
   The function returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-getsubscribed-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><?php manual_footer($setup); ?>