PHP zip_entry_open() 函数

PHP 教程 · 2019-01-30 23:29:38

定义和用法

zip_entry_open() 函数打开一个 zip 档案以供读取。

如果成功,该函数则返回 TRUE。如果失败,则返回 FALSE。

语法


zip_entry_open(zip,zip_entry,mode)


参数 描述
zip 必需。规定要读取的 zip 资源(由 zip_open() 打开的 zip 文件)。
zip_entry 必需。规定要打开的 zip 项目资源(由 zip_read() 打开的 zip 项目)。
mode 可选。规定 zip 档案项目的访问类型。

注释:在 PHP 5 中,mode 会被忽略,且总为 "rb"。这是因为在 PHP 中的 zip 支持是只读的。


实例


<?php
$zip = zip_open("test.zip");
if ($zip)
  {
  while ($zip_entry = zip_read($zip))
    {
    echo "<p>";
    echo "Name: " . zip_entry_name($zip_entry) . "<br />";
    if (zip_entry_open($zip, $zip_entry))
      {
      // some code
      }
    echo "</p>";
  }
zip_close($zip);
}
?>


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Ruby for Rails

Ruby for Rails

David Black / Manning Publications / 2006-05-11 / USD 44.95

What's Inside * How Ruby and Rails work, separately and together * Extensive Ruby language tutorial * Ruby techniques for Rails applications * Explore the Rails framework source code A new level of pr......一起来看看 《Ruby for Rails》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换