Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- Set up a child account and set screen time limit in Windows 8
- Wayback Machine - see archived versions of web pages across time
- Install PHPMailer 5.2.4 and use smtp gmail
- phpexcel toggle expand and hide column in EXCEL and summary
- Install PHP ibm_db2 extension in Linux (redHat)
- PHP: add a download as pdf file button in report page
Tuesday, November 1, 2011
PHP, compress and extract files using PclZip library
PclZip library offers PHP compression and extraction functions for Zip formatted archives. PclZip library can be downloaded from:
http://old.phpconcept.net/pclzip/index.en.php
The user menu can be found HERE.
To include pclzip library:
include_once('pclzip.lib.php');
To add or extract very large file, "memory_limit" value in php.ini needs to be increased. "memory_limit" can also set in the PHP code:
ini_set('memory_limit', '180M');
To initialize a zip instance:
$myzipfile = new PclZip('myzfile.zip');
To create a zip file from image1.jpg and image2.jpg:
$mylist = $archive->create('mydata/image1.jpg,mydata/image2.jpg',
PCLZIP_OPT_REMOVE_PATH, 'data',
PCLZIP_OPT_ADD_TEMP_FILE_ON);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment