aboutsummaryrefslogtreecommitdiff
path: root/examples/01-simple.php
blob: a01e0f8910dc54db227e31004455f4c0255ea75b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

require_once __DIR__ . '/../src/ZipStream.php';

# import zipstream class
use Pablotron\ZipStream\ZipStream;

# create the output stream
$zip = new ZipStream('example.zip');

# add a file named "hello.txt" to output archive, containing
# the string "hello world!"
$zip->add_file('hello.txt', 'hello world!');

# finalize the output stream
$zip->close();