Javascript debugger
Website design
↑
This example opens a ZIP file archive
test.zip
and add
the file /path/to/index.txt
.
as newname.txt
.
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->addFile('/path/to/index.txt', 'newname.txt');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>