note 88235 added to function.imap-fetch-overview

From: Date: Fri, 16 Jan 2009 17:15:19 +0000
Subject: note 88235 added to function.imap-fetch-overview
Groups: php.notes 
Request: Send a blank email to php-notes+get-149324@lists.php.net to get a copy of this message
That's right: calling imap_fetch_overview() once is faster, than calling it in a loop. But if you want to get a "day sorted" list, you need to call it in a loop, cause if you enter a "string" of UIDs, they are always sorted by UID, not by the order you entered it. Heres a little example how to get a date-sorted list: <?php /*Sort all msgs by Arrival Date. Newest = 0, oldest = Array Count*/ /*returns an array, containing the UIDs of messages*/ $SortedArray = imap_sort($Handle,SORTARRIVAL,1,SE_UID); For ($i = $Start; $i< $Start + $Limit; $i++){ /*Read UID from Sorted Array*/ $UID = $SortedArray[$i]; /*Get Detailed MSG Infos*/ $Overview = imap_fetch_overview($Handle, $UID, FT_UID); [...] } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 88.65.195.40 ---- Manual Page -- http://www.php.net/manual/en/function.imap-fetch-overview.php Edit -- https://master.php.net/note/edit/88235 Del: integrated -- https://master.php.net/note/delete/88235/integrated Del: useless -- https://master.php.net/note/delete/88235/useless Del: bad code -- https://master.php.net/note/delete/88235/bad+code Del: spam -- https://master.php.net/note/delete/88235/spam Del: non-english -- https://master.php.net/note/delete/88235/non-english Del: in docs -- https://master.php.net/note/delete/88235/in+docs Del: other reasons-- https://master.php.net/note/delete/88235 Reject -- https://master.php.net/note/reject/88235 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149324) next »