note 103316 modified in function.imap-fetch-overview by danbrown
| From: | danbrown@php.net | Date: | Thu, 07 Apr 2011 14:48:31 +0000 |
| Subject: | note 103316 modified in function.imap-fetch-overview by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178600@lists.php.net to get a copy of this message | ||
Hopefully someone will find this a jumpstarter for a sortable, paginated list:
<?php
public function listMessages($nStart=0, $nCnt=10) {
if (!$this->loaded) {
return NULL;
}
if (($nStart+$nCnt) > $this->getNum()) {
$nCnt = $this->getNum()-$nStart;
}
$aMsgs = imap_fetch_overview($this->rCon, ($nStart+1).':'.($nStart+$nCnt));
$aRet = array();
if ($aMsgs) {
foreach ($aMsgs as $msg) {
$aRet[$msg->udate] = $msg;
}
}
krsort($aRet);
var_dump($aRet);
}
?>
--was--
Hopefully someone will find this a jumpstarter for a sortable, paginated list:
<?
public function listMessages($nStart=0, $nCnt=10) {
if (!$this->loaded) {
return NULL;
}
if (($nStart+$nCnt) > $this->getNum()) {
$nCnt = $this->getNum()-$nStart;
}
$aMsgs = imap_fetch_overview($this->rCon, ($nStart+1).':'.($nStart+$nCnt));
$aRet = array();
if ($aMsgs) {
foreach ($aMsgs as $msg) {
$aRet[$msg->udate] = $msg;
}
}
krsort($aRet);
var_dump($aRet);
}
?>
http://php.net/manual/en/function.imap-fetch-overview.php