array Net_NNTP_Client::getGroups (
)
有効なニュースグループの一覧を返します。
array
- 二次元配列です。最初の要素が
ニュースグループ名を表し、それぞれの要素の下にニュースグループの情報が
格納されています。
$groups[newsgroup_name]['group']
ニュースグループの名前
$groups[newsgroup_name]['last']
最新の記事の記事番号
$groups[newsgroup_name]['first']
最初の記事の記事番号
$groups[newsgroup_name]['posting']
とりうる値: y
- はい、
n
- いいえ、
m
- モデレートされています
This function can not be called statically.
一般向けに公開されているニュースサーバの場合、30,000 以上のニュースグループが含まれていることもあります。そのような場合、 この関数の実行時間が
php.ini
で設定されている maximum execution time を超えてしまうかもしれません。
getGroups() の使用
<?php
...
$ret = $nntp->connect('news.php.net');
if( PEAR::isError($ret)) {
// エラー処理
} else {
// 成功
$groups = $nntp->getGroups();
// 有効なニュースグループ一覧の表示
foreach($groups as $group) {
echo $group['group'].'<br>';
}
}
?>