ZipArchive::setArchiveComment

(PHP 5 >= 5.2.0, PHP 7, PECL zip >= 1.4.0)
Set the comment of a ZIP archive
bool ZipArchive::setArchiveComment ( string $comment )

Set the comment of a ZIP archive.

Parameters:
comment

The contents of the comment.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
Create an archive and set a comment
<?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';
}
?>

doc_php
2016-02-24 15:55:42
Comments
Leave a Comment

Please login to continue.