PHP Conference Japan 2024

ZipArchive::getArchiveComment

(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.1.0)

ZipArchive::getArchiveComment返回 Zip 封存註解

說明

public ZipArchive::getArchiveComment(int $flags = 0): string|false

返回 Zip 封存註解。

參數

flags

如果 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());
/* 或是使用 archive 屬性 */
var_dump($zip->comment);
} else {
echo
'失敗,代碼:' . $res;
}
?>
新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top