<?php
// Ici, nous affichons les threads d'un newsgroup, en HTML
$nntp = imap_open('{news.example.com:119/nntp}un.newsgroup', '', ''); $threads = imap_thread($nntp);
foreach ($threads as $key => $val) { $tree = explode('.', $key); if ($tree[1] == 'num') { $header = imap_headerinfo($nntp, $val); echo "<ul>\n\t<li>" . $header->fromaddress . "\n"; } elseif ($tree[1] == 'branch') { echo "\t</li>\n</ul>\n"; } }
imap_close($nntp);
?>
|