php read zip file without extracting

Solutions on MaxInterview for php read zip file without extracting by the best coders in the world

showing results for - "php read zip file without extracting"
Garry
02 Apr 2016
1As found as a comment on http://www.php.net/ziparchive:
2
3The following code can be used to get a list of all the file names in a zip file.
4
5<?php
6$za = new ZipArchive(); 
7
8$za->open('theZip.zip'); 
9
10for( $i = 0; $i < $za->numFiles; $i++ ){ 
11    $stat = $za->statIndex( $i ); 
12    print_r( basename( $stat['name'] ) . PHP_EOL ); 
13}
14?>