<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >imap_search</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="IMAP, POP3 and NNTP Functions" HREF="ref.imap.html"><LINK REL="PREVIOUS" TITLE="imap_scanmailbox" HREF="function.imap-scanmailbox.html"><LINK REL="NEXT" TITLE="imap_set_quota" HREF="function.imap-set-quota.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.imap-scanmailbox.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.imap-set-quota.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.imap-search" ></A >imap_search</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN94812" ></A ><P > (PHP 3 >= 3.0.12, PHP 4, PHP 5)</P >imap_search -- This function returns an array of messages matching the given search criteria</DIV ><DIV CLASS="refsect1" ><A NAME="AEN94815" ></A ><H2 >Descrição</H2 >array <B CLASS="methodname" >imap_search</B > ( resource imap_stream, string criteria [, int options [, string charset]] )<BR ></BR ><P > This function performs a search on the mailbox currently opened in the given imap stream. </P ><P > For example, to match all unanswered messages sent by Mom, you'd use: "UNANSWERED FROM mom". Searches appear to be case insensitive. This list of criteria is from a reading of the UW c-client source code and may be incomplete or inaccurate (see also <A HREF="http://www.faqs.org/rfcs/rfc2060" TARGET="_top" >RFC2060</A >, section 6.4.4). </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN94835" ></A ><H2 >Parâmetros</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" > imap_stream</CODE ></DT ><DD ><P >Um stream IMAP retornado por <A HREF="function.imap-open.html" ><B CLASS="function" >imap_open()</B ></A >.</P ></DD ><DT ><CODE CLASS="parameter" >criteria</CODE ></DT ><DD ><P > A string, delimited by spaces, in which the following keywords are allowed. Any multi-word arguments (e.g. FROM "joey smith") must be quoted. <P ></P ><UL ><LI ><P > ALL - return all messages matching the rest of the criteria </P ></LI ><LI ><P > ANSWERED - match messages with the \\ANSWERED flag set </P ></LI ><LI ><P > BCC "string" - match messages with "string" in the Bcc: field </P ></LI ><LI ><P > BEFORE "date" - match messages with Date: before "date" </P ></LI ><LI ><P > BODY "string" - match messages with "string" in the body of the message </P ></LI ><LI ><P > CC "string" - match messages with "string" in the Cc: field </P ></LI ><LI ><P > DELETED - match deleted messages </P ></LI ><LI ><P > FLAGGED - match messages with the \\FLAGGED (sometimes referred to as Important or Urgent) flag set </P ></LI ><LI ><P > FROM "string" - match messages with "string" in the From: field </P ></LI ><LI ><P > KEYWORD "string" - match messages with "string" as a keyword </P ></LI ><LI ><P > NEW - match new messages </P ></LI ><LI ><P > OLD - match old messages </P ></LI ><LI ><P > ON "date" - match messages with Date: matching "date" </P ></LI ><LI ><P > RECENT - match messages with the \\RECENT flag set </P ></LI ><LI ><P > SEEN - match messages that have been read (the \\SEEN flag is set) </P ></LI ><LI ><P > SINCE "date" - match messages with Date: after "date" </P ></LI ><LI ><P > SUBJECT "string" - match messages with "string" in the Subject: </P ></LI ><LI ><P > TEXT "string" - match messages with text "string" </P ></LI ><LI ><P > TO "string" - match messages with "string" in the To: </P ></LI ><LI ><P > UNANSWERED - match messages that have not been answered </P ></LI ><LI ><P > UNDELETED - match messages that are not deleted </P ></LI ><LI ><P > UNFLAGGED - match messages that are not flagged </P ></LI ><LI ><P > UNKEYWORD "string" - match messages that do not have the keyword "string" </P ></LI ><LI ><P > UNSEEN - match messages which have not been read yet </P ></LI ></UL > </P ></DD ><DT ><CODE CLASS="parameter" >options</CODE ></DT ><DD ><P > Valid values for <CODE CLASS="parameter" >options</CODE > are <TT CLASS="constant" ><B >SE_UID</B ></TT >, which causes the returned array to contain UIDs instead of messages sequence numbers. </P ></DD ><DT ><CODE CLASS="parameter" >charset</CODE ></DT ><DD ><P > </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN94911" ></A ><H2 >Valores de retornado</H2 ><P > Returns an array of message numbers or UIDs. </P ><P > Return <TT CLASS="constant" ><B >FALSE</B ></TT > if it does not understand the search <CODE CLASS="parameter" >criteria</CODE > or no messages have been found. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN94917" ></A ><H2 >Histórico</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN94920" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Versão</TH ><TH >Descrição</TH ></TR ></THEAD ><TBODY ><TR ><TD >4.3.3</TD ><TD > The <CODE CLASS="parameter" >charset</CODE > parameter was added </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN94931" ></A ><H2 >Veja também</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.imap-listscan.html" ><B CLASS="function" >imap_listscan()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.imap-scanmailbox.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.imap-set-quota.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >imap_scanmailbox</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.imap.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >imap_set_quota</TD ></TR ></TABLE ></DIV ></BODY ></HTML >