Home · Latest · Trends  /  PHP
6

List all files in Zip archive

rated 6 times [  6] [ 0]  / comments: 0 / hits: 1773  / 3 years ago, sat, sep 10, 2016, 15:16:20
List all files in Zip archive with PHP
<?php
$info = new ZipArchive(); 
$info->open('file.zip'); 
for($i = 0; $i < $info->numFiles; $i++ ){ 
$files = $info->statIndex($i); 
echo '<pre>';
print_r(basename($files['name']));
echo '</pre>';
}
?>
More From » PHP
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Snippets
Smarty sort foreach results in Smarty file
3 years ago, sat, sep 10, 2016
Validate domain name with PHP gethostbyname
3 years ago, sat, sep 10, 2016
How to get the current url in smarty file
3 years ago, sat, sep 10, 2016
Grabbing a Favicon from external website
3 years ago, tue, feb 21, 2017
Sponsor
Posted
Michael

Michael

Member since Sep 10, 2016
Total Code Snippets: 5
Total Comments: 0
Location: n/a
Following
User not following anyone yet.