ZipArchive::setCommentName
(PHP 5 >= 5.2.0, PHP 7, PECL zip >= 1.4.0)
ZipArchive::setCommentName - 设置由其名称定义的条目的注释
描述
bool ZipArchive::setCommentName ( string $name , string $comment )
设置由其名称定义的条目的评论。
参数
name
条目的名称。
comment
评论的内容。
返回值
成功时返回TRUE
或失败时返回FALSE
。
示例
Example #1 Open an archive and set a comment for an entry
<?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';
}
?>
← ZipArchive::setCommentIndex
ZipArchive::setCompressionIndex →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com