Net_NNTP::getOverview()

Net_NNTP::getOverview() – fetch a number of message headers

Synopsis

require_once 'Net/NNTP.php';

array Net_NNTP::getOverview ( string $first , string $last )

Description

Returns all message headers in a certain range of the current selected newsgroup

Parameter

  • $first - start message id, start of the range

  • $last - last message id, end of the range

Return value

array - a nested array indicated by the message id of the article, every entry contains the header as array

<?php
$msgs
[message_id][headername] = headercontent
?>

Note

This function can not be called statically.

Be careful with choosing the range. It could requires some time to get a huge number of message headers.

Example

Using getOverview()

<?php
...
$ret $nntp->connect("news.php.net");
if( 
PEAR::isError($ret)) {
 
// handle error
} else {
 
// print the last 10 messages
 
$data $nntp->selectGroup("php.pear.dev");
 
$msgs $nntp->getOverview$data['last'] - 10$data[last]);

 foreach(
$msgs as $msg) {
    
// print subjects
    
echo $msg['Subject'].'<br>';
 }
}
?>
fetch message headers (Previous) fetch the name of message headers (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.