Net_NNTP_Realtime::getGroups() -- Fetch list of avaible newsgroups ïÐÉÓÁÎÉÅ
Returns a list of all avaible newsgroups
÷ÏÚ×ÒÁÝÁÅÍÏÅ ÚÎÁÞÅÎÉÅ
array - a two dimensional, nested array
indicated by the name of the newsgroup, every entry contains
information about the newsgroup:
$groups[newsgroup_name]['group']
Name of the newsgroup
$groups[newsgroup_name]['last']
Number of the last article
$groups[newsgroup_name]['first']
Number of the first article
$groups[newsgroup_name]['posting']
values: y - yes,
n - no,
m - moderated)
úÁÍÅÔËÁüÔÁ ÆÕÎËÃÉÑ ÎÅ ÄÏÌÖÎÁ ×ÙÚÙ×ÁÔØÓÑ ÓÔÁÔÉÞÅÓËÉ. Внимание |
Especially public news server can provide more then 30.000
newsgroup. So this function may runs longer then the maximum
execution time set in the php.ini.
|
ðÒÉÍÅÒПример 34-1. Using getGroups()
<?php
...
$ret = $nntp->connect('news.php.net');
if( PEAR::isError($ret)) {
// handle error
} else {
// success
$groups = $nntp->getGroups();
// Print a list of avaible newsgroups
foreach($groups as $group) {
echo $group['group'].'<br>';
}
}
?>
|
|
|