note 25135 deleted from function.imap-thread by didou
| From: | didou@php.net | Date: | Tue, 31 Aug 2004 02:09:19 +0000 |
| Subject: | note 25135 deleted from function.imap-thread by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75704@lists.php.net to get a copy of this message | ||
Note Submitter: IceCreamMAn at after-shock dot org
----
This is how I used imap_thread() to make a threaded list of newsgroup items.
<?php
$nntp = imap_open("{news.yourdomain.tld:119/nntp}newsgroup", "",
"");
$headers = imap_headers($nntp);
$threads = imap_thread($nntp);
while (list($key, $val) = each($threads)) {
$tree = explode(".", $key);
if ($tree[1] == "num") {
print "<ul>\n<li>" . $headers[$val - 1] . "\n";
}
else if ($tree[1] == "branch") {
print "</ul>\n";
}
}
imap_close($nntp);
?>