Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

<?


$mailbox = imap_open("{news.server.com/nntp:119}",
"leon", "password");
$name = imap_scanmailbox($mailbox, "alt.");
while(list($match) = each($name))
{
print("$match
\n");
}
imap_close($mailbox);
?>


array imap_search(integer stream, string criteria, integer
flags)


Use imap_search to get a list of message numbers based on search criteria. The
criteria argument is a list of search codes separated by spaces. The codes are listed in
Table 14.9. Some of them take an argument, which must always be surrounded by
double quotes. The optional flags argument may be set to SE_UID to cause UIDs to be
returned instead of message numbers.


Table 14.9. imap_search Criteria Codes
ALL
ANSWERED
BCC "string"
BEFORE "date"
BODY "string"
CC "string"
DELETED
FLAGGED
FROM "string"
KEYWORD "string"
NEW
OLD
ON "date"
RECENT
SEEN
SINCE "date"
SUBJECT "string"
TEXT "string"
TO "string"
UNANSWERED
UNDELETED

Free download pdf