首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ZipArchive::setArchiveComment

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

ZipArchive::setArchiveComment - 设置ZIP归档的注释

描述

代码语言:javascript
复制
bool ZipArchive::setArchiveComment ( string $comment )

设置ZIP归档的注释。

参数

comment

评论的内容。

返回值

成功时返回TRUE或失败时返回FALSE

示例

Example #1 Create an archive and set a comment

代码语言:javascript
复制
<?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';
}
?>

← ZipArchive::renameName

ZipArchive::setCommentIndex →

扫码关注腾讯云开发者

领取腾讯云代金券