CakeFest 2024: The Official CakePHP Conference

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

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
'失敗、コード:' . $res;
}
?>
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top