Home > php教程 > php手册 > body text

PHP读取ZIP文件详细信息

WBOY
Release: 2016-06-13 10:44:57
Original
747 people have browsed it

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 ?>

摘自:尐桀的博客

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!