(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.1.0)
ZipArchive::getArchiveComment — 返回 Zip 封存註解
傳回 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;
}
?>