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

search for in the

ZipArchive::GetStatusString> <ZipArchive::getFromName
Last updated: Fri, 30 Oct 2009

view this page in

ZipArchive::getNameIndex

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

ZipArchive::getNameIndexGibt den Namen eines Eintrags unter Verwendung seines Index zurück

Beschreibung

string ZipArchive::getNameIndex ( int $index )

Gibt den Namen eines Eintrags unter Verwendung seines Index zurück.

Parameter-Liste

index

Index des Eintrags.

Rückgabewerte

Gibt im Erfolgsfall den Namen, andernfalls FALSE zurück.



add a note add a note User Contributed Notes
ZipArchive::getNameIndex
Yeslifer
03-Mar-2009 12:13
I couldn't find any how-to example for getting the filenames, so I made an easy one.

Here's an example how to list all filenames from a zip-archive:

<?php
$zip
= new ZipArchive;
if (
$zip->open('items.zip'))
{
     for(
$i = 0; $i < $zip->numFiles; $i++)
     {  
          echo
'Filename: ' . $zip->getNameIndex($i) . '<br />';
     }
}
else
{
     echo
'Error reading zip-archive!';
}
?>

Hope it helps.

ZipArchive::GetStatusString> <ZipArchive::getFromName
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites