-
5
pages
-
English
-
Documents
Description
PHP Tutorials ZIP File Written By Peter Kelly http://www.peter-kelly.me/ Manipulation In this tutorial we will look in detail into the ZIP functions included in PHP. So what is a ZIP Archive. DEFINITION The ZIP file format (.zip) is a data compression and archive format. A ZIP file contains one or more files that have been compressed to reduce file size, or stored as-is. Creating A ZIP File First we need some files or information we want to compress into the ZIP. Below are some examples of what I have included in this tutorial. These files should be placed in the directories stated. test_files/test_text.txt test_files/test_html.html test_document.doc You can download copies of the test files I have used by clicking on the link at the bottom of this tutorial. So now we have the files we are going to include in the archive, let’s go through the functions we will be using in this tutorial. OPEN open(string $filename [, int $flags]); Open is used to open a new ZIP Archive for reading, writing or modifying. ADDFROMSTRING addFromString(string $local_file_name, string $contents); addFromString is used to include data into the ZIP Archive that is not already located inside a file. So this function will create a file inside the archive and insert the string contents into that file. ADDFILE addFile(string $file_name_archive, string $file_name_local); addFile is used to include an already existing file or folder into the archive. Now we ...
-
Publié par
-
Langue
English