首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ZipArchive::getFromIndex

(没有可用的版本信息,可能只在Git中)

ZipArchive::getFromIndex - 使用索引返回条目内容

描述

代码语言:javascript
复制
string ZipArchive::getFromIndex ( int $index [, int $length = 0 [, int $flags ]] )

使用索引返回条目内容。

参数

index

入口索引

length

从条目中读取的长度。如果为0,则读取整个条目。

flags

用于打开存档的标志。以下值可能会与其进行ORed运算。

  • ZipArchive::FL_UNCHANGED
  • ZipArchive::FL_COMPRESSED

返回值

成功返回内容条目时或失败时返回FALSE

示例

Example #1 Get the file contents

代码语言:javascript
复制
<?php
$zip?=?new?ZipArchive;
if?($zip->open('test.zip')?===?TRUE)?{
????echo?$zip->getFromIndex(2);
????$zip->close();
}?else?{
????echo?'failed';
}
?>

另请参考

  • ZipArchive::getFromName() - 使用其名称返回条目内容

← ZipArchive::getExternalAttributesName

ZipArchive::getFromName →

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com