previousNet_NNTP_Client::quit() (Previous) (Next) Net_NNTPnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Net_NNTP_Client::selectGroup()

Net_NNTP_Client::selectGroup() – ニュースグループを選択する

Synopsis

require_once 'Net/NNTP/Client.php';

array Net_NNTP_Client::selectGroup ( string $newsgroup )

Description

NNTP サーバ上の指定したニュースグループを選択します。

Parameter

  • string $newsgroup - アクセスしたいニュースグループ名。

Return value

array - ニュースグループが存在した場合、 配列が返されます:

キー
'count' グループ内の記事の数
'first' グループ内の最初の記事番号
'last' グループ内の最後の記事番号
'group' グループ名
それ以外の場合、PEAR_Error が返されます。

Throws

Possible PEAR_Error values
エラー番号 エラーメッセージ 原因 対応方法
NULL いろいろなエラーメッセージ ニュースサーバから返される文字列をそのままの形式で返します。 たいがいの場合、存在しない記事を取得しようとしたことが原因です。

Note

This function can not be called statically.

Example

selectGroup() の使用

<?php
...
$ret $nntp->connect('news.php.net');
if( 
PEAR::isError($ret)) {
    
// エラー処理
} else {
    
// 成功
    
$data $nntp->selectGroup('php.pear.dev');
    
// 記事の数を取得する
    
echo "記事の数: "$data['last'] - $data['first'];
}
?>
previousNet_NNTP_Client::quit() (Previous) (Next) Net_NNTPnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.