Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17999 программистов и 1637 роботов. Сейчас ищут 2102 программиста ...
Net_NNTP_Client::getOverview()
Вернуться к: Net_NNTP_Client
Net_NNTP_Client::getOverview()
Net_NNTP_Client::getOverview() – Fetch newsgroup overview
Synopsis
require_once 'Net/NNTP/Client.php';
array Net_NNTP_Client::getOverview ( string $first , string $last )
Returns (a certain range of) the overview of the currently selected newsgroup. selected newsgroup
Parameter
-
$first - first article number, start of the range
-
$last - last article number, 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>';
}
}
?>
Вернуться к: Net_NNTP_Client