note 105312 modified in class.ziparchive by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Aug 2011 21:05:33 +0000 |
| Subject: | note 105312 modified in class.ziparchive by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182352@lists.php.net to get a copy of this message | ||
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 );
}
?>
--was--
The following code can be used to get a list of all the file names in a zip file.
$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 );
}
http://php.net/manual/en/class.ziparchive.php