Net_NNTP_Client::getGroups()

Net_NNTP_Client::getGroups() – Fetch list of avaible newsgroups

Synopsis

require_once 'Net/NNTP/Client.php';

array Net_NNTP_Client::getGroups ( )

Description

Returns a list of all avaible newsgroups

Return value

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)

Note

This function can not be called statically.

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.

Example

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>';
    }
}
?>
Get date from NNTP-server (Previous) Fetch the header of an article from the NNTP-server (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.