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
- Using Cron Job to process PHP scripts
- Install PHPMailer 5.2.4 and use smtp gmail
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- Datatable export excel wraptext and newline
- Set up a child account and set screen time limit in Windows 8
- PHP - Export Content to MS Word document
- PHP connect IBM db2 database in XAMPP
- PHP: add a download as pdf file button in report page
- Ajax autosave selection without submit button
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