ZipArchive::deleteIndex

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

ZipArchive::deleteIndexDelete an entry in the archive using its index

说锟斤拷

ZipArchive::deleteIndex ( int $index ) : bool

Delete an entry in the archive using its index.

锟斤拷锟斤拷

index

Index of the entry to delete.

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #1 Delete file from archive using its index

<?php
$zip 
= new ZipArchive;
if (
$zip->open('test.zip') === TRUE) {
    
$zip->deleteIndex(2);
    
$zip->close();
    echo 
'ok';
} else {
    echo 
'failed';
}
?>