<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.imap-list.php',
    1 => 'imap_list',
    2 => 'Liefert die Liste der Postf&auml;cher',
  ),
  'up' => 
  array (
    0 => 'ref.imap.php',
    1 => 'IMAP Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imap-last-error.php',
    1 => 'imap_last_error',
  ),
  'next' => 
  array (
    0 => 'function.imap-listmailbox.php',
    1 => 'imap_listmailbox',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/imap/functions/imap-list.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imap-list" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_list</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_list</span> &mdash; <span class="dc-title">Liefert die Liste der Postfächer</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imap-list-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_list</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">
   Gibt die Liste aller Pöstfächer zurück.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imap-list-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">imap</code></dt><dd><p class="para">Eine <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>-Instanz.</p></dd>
    
     <dt><code class="parameter">reference</code></dt>
     <dd>
      <p class="para">
       Die Angabe des Servers in der in <span class="function"><a href="function.imap-open.php" class="function">imap_open()</a></span>
       beschriebenen Form.
      </p>
      <div class="warning"><strong class="warning">Warnung</strong><p class="simpara">
Die Übergabe von nicht vertrauenswürdigen Daten an diesen Parameter ist <em>unsicher</em>,falls
<a href="imap.configuration.php#ini.imap.enable-insecure-rsh" class="link">imap.enable_insecure_rsh</a> nicht deaktiviert ist.
</p></div>
     </dd>
    
    
     <dt><code class="parameter">pattern</code></dt>
     <dd>
      <p class="para">Gibt an, wo in der Postfach-Hierarchie
mit der Suche begonnen werden soll.</p>
<p class="para">Es gibt zwei Sonderzeichen, die
man als Teil von <code class="parameter">pattern</code> verwenden kann:
&#039;<code class="literal">*</code>&#039; und &#039;<code class="literal">%</code>&#039;.
&#039;<code class="literal">*</code>&#039; heißt, dass alle Postfächer zurückgegeben
werden sollen. Wenn man <code class="parameter">pattern</code> als
&#039;<code class="literal">*</code>&#039; übergibt, so erhält man eine Liste der
vollständigen Postfach-Hierarchie. &#039;<code class="literal">%</code>&#039; heißt,
dass nur die aktuelle Stufe zurückgegeben wird.
&#039;<code class="literal">%</code>&#039; als Wert des Parameters <code class="parameter">pattern</code> gibt nur die Postfächer der obersten Ebene zurück.
&#039;<code class="literal">~/mail/%</code>&#039; unter <code class="literal">UW_IMAPD</code> gibt alle Postfächer des
Verzeichnisses <var class="filename">~/mail</var> zurück, aber keine aus dessen Unterverzeichnissen.</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imap-list-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt ein Array mit den Namen der gefundenen Postfächer zurück oder <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   im Fehlerfall.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-list-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Der Parameter <code class="parameter">imap</code> erwartet nun eine
  <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>-Instanz; vorher wurde eine gültige
  <code class="literal">imap</code>-<a href="language.types.resource.php" class="link">Ressource</a> erwartet.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imap-list-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>imap_list()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$mbox </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}"</span><span style="color: #007700">, </span><span style="color: #DD0000">"username"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">, </span><span style="color: #0000BB">OP_HALFOPEN</span><span style="color: #007700">)<br />      or die(</span><span style="color: #DD0000">"Kann keine Verbindung aufbauen: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$list </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_list</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">, </span><span style="color: #DD0000">"{imap.example.org}"</span><span style="color: #007700">, </span><span style="color: #DD0000">"*"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$list</span><span style="color: #007700">)) {<br />    foreach (</span><span style="color: #0000BB">$list </span><span style="color: #007700">as </span><span style="color: #0000BB">$val</span><span style="color: #007700">) {<br />        echo </span><span style="color: #0000BB">imap_utf7_decode</span><span style="color: #007700">(</span><span style="color: #0000BB">$val</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />    }<br />} else {<br />    echo </span><span style="color: #DD0000">"imap_list schlug fehl: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">() . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 seealso" id="refsect1-function.imap-list-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.imap-getmailboxes.php" class="function" rel="rdfs-seeAlso">imap_getmailboxes()</a> - Liefert detaillierte Informationen zu allen Postf&auml;chern</span></li>
    <li><span class="function"><a href="function.imap-lsub.php" class="function" rel="rdfs-seeAlso">imap_lsub()</a> - Liefert eine Liste aller abonnierten Postf&auml;cher</span></li>
   </ul>
  </p>
 </div>


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