tags:

views:

92

answers:

2

i just want making a system that can open a file in a zip archive like i have archive.zip in this file.text i want make a class to makr this page zip.php?archiver=archive.zip&file=file.text i want this page show me the file.text contents any ideas?

+1  A: 

you could probably do this:

http://www.php.net/manual/en/function.ziparchive-getfromname.php

it's a function in http://php.net/manual/en/book.zip.php

John Boker
+2  A: 

From the PHP manual: ZipArchive::getFromName(). This is exactly what you need.

<?php
$z = new ZipArchive();
if ($z->open(dirname(__FILE__) . '/test_im.zip')) {
    $string = $z->getFromName("mytext.txt");
    echo $string;
}
?>

Best wishes,
Fabian

halfdan
This is exactly what i need
moustafa