Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<imap_last_errorimap_listmailbox>
Last updated: Tue, 19 Sep 2006

imap_list

(PHP 3 >= 3.0.4, PHP 4, PHP 5)

imap_list -- Read the list of mailboxes

Description

array imap_list ( resource imap_stream, string ref, string pattern )

Returns an array containing the names of the mailboxes. See imap_getmailboxes() for a description of ref and pattern.

Example 1. imap_list() example

<?php
$mbox = imap_open("{imap.example.org}", "username", "password", OP_HALFOPEN)
      or die("can't connect: " . imap_last_error());
 
$list = imap_list($mbox, "{imap.example.org}", "*");
if (is_array($list)) {
    foreach ($list as $val) {
        echo imap_utf7_decode($val) . "<br />\n";
    }
} else {
    echo "imap_list failed: " . imap_last_error() . "\n";
}

imap_close($mbox);
?>

See also: imap_getmailboxes().




<imap_last_errorimap_listmailbox>
Last updated: Tue, 19 Sep 2006