ZipArchive::getArchiveComment
(PHP 5 >= 5.2.0, PHP 7, PECL zip >= 1.1.0)
ZipArchive::getArchiveComment — ZIP アーカイブのコメントを返す
説明
ZipArchive::getArchiveComment
([ int
$flags
] ) : stringZip アーカイブのコメントを返します。
パラメータ
-
flags -
ZipArchive::FL_UNCHANGEDを設定すると、 元の変更されていないコメントを返します。
返り値
Zip アーカイブのコメントを返します。失敗した場合に FALSE を返します。
例
例1 アーカイブのコメントの出力
<?php
$zip = new ZipArchive;
$res = $zip->open('test_with_comment.zip');
if ($res === TRUE) {
var_dump($zip->getArchiveComment());
/* あるいはアーカイブのプロパティを使用します */
var_dump($zip->comment);
} else {
echo '失敗、コード:' . $res;
}
?>