Hello, is there an easy way to open and create a zip with PHP?
+4
A:
Have a look at the PHP Zip library. Here are a few tutorials on the subject:
Marius
2009-10-07 13:17:41
+3
A:
Take a look at the documentation for ZipArchive
, particularly the open
method.
You use it like this:
<?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';
}
?>
Dominic Rodger
2009-10-07 13:18:34