您的位置:寻梦网首页编程乐园PHP 编程PHP5中文手册
PHP5中文手册

ZipArchive::getFromIndex

(No version information available, might be only in CVS)

ZipArchive::getFromIndex — Returns the entry contents using its index.

说明

mixed ZipArchive::getFromIndex ( int $index [, int $flags ] )

Returns the entry contents using its index.

参数

index

Index of the entry

flags

The flags to use to open the archive. the following values may be ORed to it.

  • ZIPARCHIVE::FL_UNCHANGED

  • ZIPARCHIVE::FL_COMPRESSED

返回值

Returns the contents of the entry on success or FALSE on failure.

范例

Example#1 Get the file contents

<?php
$zip 
= new ZipArchive;
if (
$zip->open('test.zip') === TRUE) {
    echo 
$zip->getFromIndex(2);
    
$zip->close();
} else {
    echo 
'failed';
}
?>