ZipArchive::setArchiveComment

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

ZipArchive :: setArchiveComment - ZIP 아카이브의 주석 설정


설명

public ZipArchive::setArchiveComment(string $comment): bool

ZIP 아카이브의 주석을 설정합니다.


매개변수

comment
댓글 내용입니다.

반환 값

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


Examples

예 #1 아카이브 생성 및 댓글 설정

                  
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip', ZipArchive::CREATE);
if ($res === TRUE) {
    $zip->addFromString('test.txt', 'file content goes here');
    $zip->setArchiveComment('new archive comment');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>