PHP code example of jazor / zip-store
1. Go to this page and download the library: Download jazor/zip-store library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jazor / zip-store example snippets
$zip = new ZipStore();
//simple file
$zip->addFile("{$base}store.txt");
//file with extra name
$zip->addFile("{$base}extra.txt", 'files/extra.txt');
$zip->addFile("{$base}你好.txt", 'files/你好.txt');
//directory with base name
$zip->addDirectory("{$base}files", 'extra-files');
//raw contents
$zip->addContents('i am hello world!', 'my name.jpg');
//save to file
$zip->save("{$base}dest.zip");
//or send to client
//$zip->send('dest.zip');