The Little Guy Posted May 28, 2008 Share Posted May 28, 2008 Is there a way to count the number of files in a zip file? Link to comment https://forums.phpfreaks.com/topic/107656-count-zipped-files/ Share on other sites More sharing options...
Orio Posted May 28, 2008 Share Posted May 28, 2008 Although I've never used these, I am sure you'll be able to do that using the zip file functions. Orio. Link to comment https://forums.phpfreaks.com/topic/107656-count-zipped-files/#findComment-551868 Share on other sites More sharing options...
The Little Guy Posted May 28, 2008 Author Share Posted May 28, 2008 none of the zip functions have anything to do with counting the files... Link to comment https://forums.phpfreaks.com/topic/107656-count-zipped-files/#findComment-551879 Share on other sites More sharing options...
Orio Posted May 29, 2008 Share Posted May 29, 2008 After reading some examples, I think this is what you're looking for: <?php $zip = zip_open("test.zip"); $count = 0; if ($zip) { while ($zip_entry = zip_read($zip)) $count++; zip_close($zip); } echo $count; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/107656-count-zipped-files/#findComment-552848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.