<?php /* Some code examples for TbsZip Skrol29, 2010-09-03 */ include_once 'tbszip.php'; // load the TbsZip library $zip = new clsTbsZip(); // create a new instance of the TbsZip class $zip->CreateNew(); // start a new empty archive for adding files // or $zip->Open('an_existing_archive.zip'); // open an existing archive for reading and/or modifying // -------------------------------------------------- // Reading information and data in the opened archive // -------------------------------------------------- // check if a file is existing in the archive, the name must precise subfolders if any $ok = $zip->FileExists('subfolder/help.html'); // count the files stored in the archive $file_nbr = count($zip->CdFileLst); // retrieve the content of an compressed file in the archive $text1 = $zip->FileRead('readme.txt'); // retrieve the content of an compressed file in a subfolder of the archive $text2 = $zip->FileRead('subfolder/readme.txt'); if ($ok) { $zip->FileExists('subfolder/help.html'); } // ----------------------------- // Modifying data in the archive // -----------------------------