RarArchive::getComment

rar_comment_get

(PECL rar >= 2.0.0)

RarArchive::getComment -- rar_comment_getRAR アーカイブのコメントテキストを取得する

説明

オブジェクト指向型 (メソッド)

public RarArchive::getComment(): string

手続き型:

rar_comment_get(RarArchive $rarfile): string

RAR アーカイブに格納された (グローバル) コメントを取得します。長さは最大 64 KiB までです。

注意:

この拡張モジュールは、エントリごとのコメントをサポートしていません。

パラメータ

rarfile

rar_open() でオープンした RarArchive オブジェクト。

戻り値

コメントを返します。コメントがない場合は null を返します。

注意:

RAR は現在 unicode のコメントに対応していません。この関数の結果のエンコーディングは指定されていませんが、 おそらく Windows-1252 となるでしょう。

例1 オブジェクト指向型

<?php
$rar_arch
= RarArchive::open('commented.rar');
echo
$rar_arch->getComment();
?>

上の例の出力は、 たとえば以下のようになります。

This is the comment of the file commented.rar.

例2 手続き型

<?php
$rar_arch
= rar_open('commented.rar');
echo
rar_comment_get($rar_arch);
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top