downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ZipArchive::getFromName> <ZipArchive::getCommentName
[edit] Last updated: Sat, 25 May 2013

view this page in

ZipArchive::getFromIndex

(PHP 5 >= 5.2.0, PECL zip >= 1.3.0)

ZipArchive::getFromIndexDevuelve el contenido de la entrada usando su índice

Descripción

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

Devuelve el contenido de la entrada usando su índice.

Parámetros

index

El índice de la entrada

length

La longitud que se see desde la entrada. Si es 0, entonces toda la entrada se lee.

flags

Las flags usadas para abrir el fichero. Los siguientes valores pueden ser Ored.

  • ZIPARCHIVE::FL_UNCHANGED

  • ZIPARCHIVE::FL_COMPRESSED

Valores devueltos

Devuelve el contenido de la entrada si se ejecutó con éxito o FALSE en caso de error.

Ejemplos

Ejemplo #1 Obtener el contenido del fichero

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


add a note add a note User Contributed Notes ZipArchive::getFromIndex - [1 notes]
up
0
jana.vasseru
5 years ago
Note that getFromIndex returns false for directories.

 
show source | credits | sitemap | contact | advertising | mirror sites