Home >Backend Development >PHP Tutorial >PHP reads ZIP file details_PHP tutorial

PHP reads ZIP file details_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:46:27796browse

02 $zip = zip_open("20101105.zip"); 

03 if ($zip) { 

04     while ($zip_entry = zip_read($zip)) { 

05         echo "Name: " . zip_entry_name($zip_entry) . "
"; 

06         echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "
"; 

07         echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "
"; 

08         echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "
"; 

09         if (zip_entry_open($zip, $zip_entry, "r")) { 

10             echo "File Contents:" . "
"; 

11             $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); 

12             echo "$buf"; 

13             zip_entry_close($zip_entry); 

14         } 

15         echo "
"; 

16     } 

17     zip_close($zip); 

18 } 

19 ?>

摘自:尐桀的博客

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478592.htmlTechArticle?php 02 $zip = zip_open(20101105.zip); 03 if ($zip) { 04 while ($zip_entry = zip_read($zip)) { 05 echo Name: . zip_entry_name($zip_entry) . br/; 06 echo Actual Filesize: . zip_entr...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn