imap_sort
imap_sort
Gets and sort messages
**imap_sort** IMAP\Connection $imap int $criteria bool $reverse int $flags $search_criteria $charset
Gets and sorts message numbers by the given parameters.
criteria
Criteria can be one (and only one) of the following:
- - message Date `SORTDATE`
-
- arrival date
SORTARRIVAL
- arrival date
-
- mailbox in first From address
SORTFROM
- mailbox in first From address
-
- message subject
SORTSUBJECT
- message subject
-
- mailbox in first To address
SORTTO
- mailbox in first To address
-
- mailbox in first cc address
SORTCC
- mailbox in first cc address
-
- size of message in octets
SORTSIZE
- size of message in octets
reverseWhether to sort in reverse order.
flags
The are a bitmask of one or more of the
following:
`flags`- - Return UIDs instead of sequence numbers `SE_UID`
-
- Don't prefetch searched messages
SE_NOPREFETCH
- Don't prefetch searched messages
search_criteria
IMAP2-format search criteria string. For details see
.
imap_search
charsetMIME character set to use when sorting strings.
Returns an array of message numbers sorted by the given parameters, return.falseforfailure.