array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'ziparchive.getcommentindex.php', 1 => 'ZipArchive::getCommentIndex', ), 'up' => array ( 0 => 'class.ziparchive.php', 1 => 'ZipArchive', ), 'prev' => array ( 0 => 'ziparchive.getarchiveflag.php', 1 => 'ZipArchive::getArchiveFlag', ), 'next' => array ( 0 => 'ziparchive.getcommentname.php', 1 => 'ZipArchive::getCommentName', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/zip/ziparchive/getcommentindex.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.4.0)
ZipArchive::getCommentIndex — Retourne le commentaire d'une entrée
Retourne le commentaire d'une entrée en utilisant l'index de l'entrée.
index
Index de l'entrée
flags
Si ce flag est défini à ZipArchive::FL_UNCHANGED
,
le commentaire original est retourné.
Retourne le commentaire en cas de succès ou false
si une erreur survient.
Exemple #1 Affiche le commentaire d'une entrée
<?php
$zip = new ZipArchive;
$res = $zip->open('test1.zip');
if ($res === TRUE) {
var_dump($zip->getCommentIndex(1));
} else {
echo 'échec, code:' . $res;
}
?>