note 41435 added to function.imap-fetch-overview

From: Date: Fri, 09 Apr 2004 21:21:19 +0000
Subject: note 41435 added to function.imap-fetch-overview
Groups: php.notes 
Request: Send a blank email to php-notes+get-67927@lists.php.net to get a copy of this message
About the sequence sorting again. I've found that there's a significant speed improvement by preparing the sequence and then fetch them at once with large mailboxes. On small mailboxes wyou will not notice a speed difference. But then there's the sorting problem. I've spent all night fiuring out how to do this myself. I found the solution! Prepare an array of messages with imap_sort. Create a second array that maps the message numbers to the actuall place in the fetched array. You know it will be in numeric order so you can make an array map with the sort() function sorting it from high to low. Then you can proces the array fetched with imap_fetch_overview with the array_map and you will have them sorted. If you need an example look in the Group-Office code classes/imap.class.inc in a version later then 2.04. ---- Manual Page -- http://www.php.net/manual/en/function.imap-fetch-overview.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41435 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41435&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41435&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67927) next »