首页 >函数列表 >imap_list

imap_list

imap_list

(PHP 4, PHP 5)

imap_listRead the list of mailboxes

说明

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

Read the list of mailboxes.

参数

imap_stream

imap_open() 返回的 IMAP 流。

ref

ref should normally be just the server specification as described in imap_open().

pattern

指定在邮箱层级的何处开始查找。

在组成 pattern 的字符中可使用两个特殊字符: '*' 和 '%'。 '*' 是指返回所有邮箱目录. 如果将'*'作为 pattern 参数时, 则会返回整个邮箱层级结构。 '%' 是指只返回当前级次。 '%' 作为 pattern 参数则只会返回顶层邮箱; '~/mail/%' 用于 UW_IMAPD 则会返回名为 ~/mail 的目录, 但不包含其子目录。

返回值

Returns an array containing the names of the mailboxes.

范例

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) . " ";
    }
} else {
    echo 
"imap_list failed: " imap_last_error() . " ";
}

imap_close($mbox);
?>

参见


  • imap_8bit
  • imap_alerts
  • imap_append
  • imap_base64
  • imap_binary
  • imap_body
  • imap_bodystruct
  • imap_check
  • imap_clearflag_full
  • imap_close
  • imap_create
  • imap_createmailbox
  • imap_delete
  • imap_deletemailbox
  • imap_errors
  • imap_expunge
  • imap_fetchbody
  • imap_fetchheader
  • imap_fetchmime
  • imap_fetchstructure
  • imap_fetchtext
  • imap_fetch_overview
  • imap_gc
  • imap_getacl
  • imap_getmailboxes
  • imap_getsubscribed
  • imap_get_quota
  • imap_get_quotaroot
  • imap_header
  • imap_headerinfo
  • imap_headers
  • imap_last_error
  • imap_list
  • imap_listmailbox
  • imap_listscan
  • imap_listsubscribed
  • imap_lsub
  • imap_mail
  • imap_mailboxmsginfo
  • imap_mail_compose
  • imap_mail_copy
  • imap_mail_move
  • imap_mime_header_decode
  • imap_msgno
  • imap_num_msg
  • imap_num_recent
  • imap_open
  • imap_ping
  • imap_qprint
  • imap_rename
  • imap_renamemailbox
  • imap_reopen
  • imap_rfc822_parse_adrlist
  • imap_rfc822_parse_headers
  • imap_rfc822_write_address
  • imap_savebody
  • imap_scan
  • imap_scanmailbox
  • imap_search
  • imap_setacl
  • imap_setflag_full
  • imap_set_quota
  • imap_sort
  • imap_status
  • imap_subscribe
  • imap_thread
  • imap_timeout
  • imap_uid
  • imap_undelete
  • imap_unsubscribe
  • imap_utf7_decode
  • imap_utf7_encode
  • imap_utf8
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道