PHP Conference Japan 2024

ZipArchive::getCommentName

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

ZipArchive::getCommentName使用項目名稱返回項目的註解

說明

public ZipArchive::getCommentName(string $name, int $flags = 0): string|false

使用項目名稱返回項目的註解。

參數

name

項目名稱

flags

如果 flags 設定為 ZipArchive::FL_UNCHANGED,則會返回原始未更改的註解。

返回值

成功時返回註解,失敗時返回 false

範例

範例 #1 傾印項目註解

<?php
$zip
= new ZipArchive;
$res = $zip->open('test1.zip');
if (
$res === TRUE) {
var_dump($zip->getCommentName('test/entry1.txt'));
} else {
echo
'failed, code:' . $res;
}
?>
新增註解

使用者提供的註解

此頁面沒有使用者提供的註解。
To Top