bool imap_close ( resource imap_stream [, int flag] )
Closes the imap stream. Takes an optional
flagCL_EXPUNGE,
which will silently expunge the mailbox before closing,
removing all messages marked for deletion.
Instead of using the CL_EXPUNGE FLAG,
you can also use the imap_expunge function to delete all the messages marked for deletion, before calling the imap_close function.