Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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 ); 
}
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #read #zip #file #extracting
ADD COMMENT
Topic
Name
6+7 =