compress ( $des_zip, $paths )

Compress attached files and folders.

Usage

require_once 'compress.php'; //attactched source script library compression file into your project.
$zip = new ESCompress(); // initialized ESCompress compression object.
$result = $zip->compress('sample1.zip');  // Compress attached files and folders.
if(!$result){
    echo 'Cannot compressed now.';
}

Parameters

$source_path

(string) (required) absolute or related file path.

$des_path

(array) (optional) more than one files or directories attached as paths array.

Return Values

(array) Returns true , If has been compression success or fail return (boolean) false .

Example

.1 Give compression file path as required parameter.

$zip->add_file('sample1.txt'); 
$result = $zip->compress('sample1.zip');
if(!$result){
    echo 'Cannot compressed now.';
}

.2 Attached single file or folder into compression file as secondary parameter.

$result = $zip->compress('sample1.zip','E:\folder\sample3.txt');
if(!$result){
    echo 'Cannot compressed now.';
}

.3 Attached more than one file or folder as secondary path array.

$result = $zip->compress('sample1.zip', array('sample1', 'E:\folder\sample3.txt'));
if(!$result){
    echo 'Cannot compressed now.';
}
905

published
function () add_file published
function () add_folder published
function () overwrite published
function () as_new published
function () extract published

What is the codrate ?

codrate.com is a standard, fast cross browsing and highly versatile site. It is useful for many large number of Program Development Industries. So you can get support form Codrators , who are the codrate's joiners around world to help your program developments, You can answer other codrator's questions. Communicate with them. Share your knowledge with them. Do you have an interest in programming, So publish your articles about programming. It will help to maintain your professional co-profile. Actually codrate.com is not such as a regular web site. It will be gave new experience, best narrow cross-browser view, reduce processing time to receive browsing request, it's mean do not wasting your time to browsing codrate's web pages because it has been upgrade always modern coding ways. So, what do you waiting for ?. Try your own.

Copyright 2015 Pride - Company. Design by Esila