note 86209 modified in ref.zip by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
in regards to the extracting via unzip.lib.php:
Don't forget to also put in the file path.
Otherwise you end up with a lot of files in the wrong folder...

<?php
require_once("zip.lib.php");
require_once("unzip.lib.php");

$zip = new SimpleUnzip();
$filename = "myzippedfile.zip";
$entries = $zip->ReadFile($filename);

foreach ($entries as $entry){
     $fh = fopen($entry->Path .'/'.$entry->Name, 'w', false);
    fwrite($fh,$entry->Data);
    fclose($fh);
}
?>

--was--
in regards to the extracting via unzip.lib.php:
Don't forget to also put in the file path.
Otherwise you end up with a lot of files in the wrong folder...

require_once("zip.lib.php");
require_once("unzip.lib.php");

$zip = new SimpleUnzip();
$filename = "myzippedfile.zip";
$entries = $zip->ReadFile($filename);

foreach ($entries as $entry){
     $fh = fopen($entry->Path .'/'.$entry->Name, 'w', false);
    fwrite($fh,$entry->Data);
    fclose($fh);
}

http://php.net/manual/en/ref.zip.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.