Horje
php read zip file without extracting Code Example
php read zip file without extracting
As found as a comment on http://www.php.net/ziparchive:

The following code can be used to get a list of all the file names in a zip file.

<?php
$za = new ZipArchive(); 

$za->open('theZip.zip'); 

for( $i = 0; $i < $za->numFiles; $i++ ){ 
    $stat = $za->statIndex( $i ); 
    print_r( basename( $stat['name'] ) . PHP_EOL ); 
}
?>
php extract zip
<?php
$unzip = new ZipArchive;
$out = $unzip->open('wordpress.zip');
if ($out === TRUE) {
  $unzip->extractTo(getcwd());
  $unzip->close();
  echo 'File unzipped';
} else {
  echo 'Error';
}
?>




Php

Related
codeigniter 4 redirect to home Code Example codeigniter 4 redirect to home Code Example
php json encode Code Example php json encode Code Example
var dump php look clear Code Example var dump php look clear Code Example
laravel belongs to Code Example laravel belongs to Code Example
What does PEAR stands for? Code Example What does PEAR stands for? Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7