array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'ziparchive.getarchivecomment.php', 1 => 'ZipArchive::getArchiveComment', ), 'up' => array ( 0 => 'class.ziparchive.php', 1 => 'ZipArchive', ), 'prev' => array ( 0 => 'ziparchive.extractto.php', 1 => 'ZipArchive::extractTo', ), 'next' => array ( 0 => 'ziparchive.getarchiveflag.php', 1 => 'ZipArchive::getArchiveFlag', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/zip/ziparchive/getarchivecomment.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.1.0)
ZipArchive::getArchiveComment — Returns the Zip archive comment
Returns the Zip archive comment.
flags
If flags is set to ZipArchive::FL_UNCHANGED
, the original unchanged
comment is returned.
Returns the Zip archive comment or false
on failure.
Example #1 Dump an archive comment
<?php
$zip = new ZipArchive;
$res = $zip->open('test_with_comment.zip');
if ($res === TRUE) {
var_dump($zip->getArchiveComment());
/* Or using the archive property */
var_dump($zip->comment);
} else {
echo 'failed, code:' . $res;
}
?>