ZipArchive::setCommentName

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

ZipArchive::setCommentName — 이름으로 정의된 항목의 주석 설정


설명

public ZipArchive::setCommentName(string $name, string $comment): bool

이름으로 정의된 항목의 주석을 설정합니다.


매개변수

name
항목의 이름입니다.
comment
댓글 내용입니다.

반환 값

성공하면 true를, 실패하면 false를 반환합니다.


Examples

예 #1 아카이브를 열고 항목에 대한 설명 설정

                  
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip');
if ($res === TRUE) {
    $zip->setCommentName('entry1.txt', 'new entry comment');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>