Summary: Gets and sort messages
PHP 5Related methods: none
array imap_sort(resource $imap_stream, int $criteria, int $reverse[, int $options = 0, string NULL = NULL, string NULL = NULL])
Description
Gets and sorts message numbers by the given parameters.
Return: array
Returns an array of message numbers sorted by the given parameters.
Parameters
Mandatory
- resource $imap_stream: An IMAP stream returned by imap_open().
- int $criteria: Criteria can be one (and only one) of the following:
SORTDATE
- message DateSORTARRIVAL
- arrival dateSORTFROM
- mailbox in first From addressSORTSUBJECT
- message subjectSORTTO
- mailbox in first To addressSORTCC
- mailbox in first cc addressSORTSIZE
- size of message in octets - int $reverse: Set this to 1 for reverse sorting
Optional
- int $options [ = 0]: The
options
are a bitmask of one or more of the following:SE_UID
- Return UIDs instead of sequence numbersSE_NOPREFETCH
- Don't prefetch searched messages - string NULL [ = NULL]: IMAP2-format search criteria string. For details see imap_search().
- string NULL [ = NULL]: MIME character set to use when sorting strings.