Home > Backend Development > PHP Tutorial > 怎么获得ZIP文件中压缩文件的个数

怎么获得ZIP文件中压缩文件的个数

WBOY
Release: 2016-06-13 10:45:27
Original
1659 people have browsed it

如何获得ZIP文件中压缩文件的个数?
在PHP中,如何获得ZIP文件中压缩文件的个数?

------解决方案--------------------
这样写

PHP code
$zip= zip_open('zip文件名');$n = 0;while($rs = zip_read($zip)) {  $f = zip_entry_name($rs); //取得文件名  if(substr($f, -1) != '/') $n++;}echo $n;<div class="clear">
                 
              
              
        
            </div>
Copy after login
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template