array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'ziparchive.renameindex.php', 1 => 'ZipArchive::renameIndex', ), 'up' => array ( 0 => 'class.ziparchive.php', 1 => 'ZipArchive', ), 'prev' => array ( 0 => 'ziparchive.registerprogresscallback.php', 1 => 'ZipArchive::registerProgressCallback', ), 'next' => array ( 0 => 'ziparchive.renamename.php', 1 => 'ZipArchive::renameName', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/zip/ziparchive/renameindex.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.5.0)
ZipArchive::renameIndex — Renomme une entrée définie par son index
Renomme une entrée définie par son index.
index
Index de l'entrée à renommer
new_name
Nouveau nom
Exemple #1 Renommer une entrée
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip');
if ($res === TRUE) {
$zip->renameIndex(2,'newname.txt');
$zip->close();
} else {
echo 'échec, code:' . $res;
}
?>