PHP.nl

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
    • mailbox in first From address SORTFROM
    • message subject SORTSUBJECT
    • mailbox in first To address SORTTO
    • mailbox in first cc address SORTCC
    • size of message in octets SORTSIZE

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

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.