object imap_status ( resource $imap_stream , string $mailbox , int $options )
Gets status information about the given mailbox.
This function returns an object containing status information. The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity. flags is also set, which contains a bitmask which can be checked against any of the above constants.