(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.4.0)
ZipArchive::getCommentIndex — 使用項目索引回傳項目的註解
成功時返回註釋,失敗時返回 false
。
範例 #1 傾印出項目的註釋
<?php
$zip = new ZipArchive;
$res = $zip->open('test1.zip');
if ($res === TRUE) {
var_dump($zip->getCommentIndex(1));
} else {
echo '失敗,代碼:' . $res;
}
?>