aboutsummaryrefslogtreecommitdiff
path: root/examples/01-simple.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/01-simple.php')
-rw-r--r--examples/01-simple.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/01-simple.php b/examples/01-simple.php
new file mode 100644
index 0000000..a01e0f8
--- /dev/null
+++ b/examples/01-simple.php
@@ -0,0 +1,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();