ZipArchive() (adding a directory)
- From: "techjohnny@xxxxxxxxx" <techjohnny@xxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:26:27 -0800 (PST)
Hello, group:
I'm able to successfully add files to a zip archive using php with the
following script, but I can't find anywhere I add directories, can
somebody help?
Thanks,
--TJ
<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test
string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test
string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
$zip->close();
?>
.
- Prev by Date: Re: Comparison function for directories?
- Next by Date: Re: A better way to handle real-time data?
- Previous by thread: Using macports to update php?
- Next by thread: Re: A better way to handle real-time data?
- Index(es):