Home  >  Article  >  Backend Development  >  zip class application example in CI framework_PHP tutorial

zip class application example in CI framework_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:24:44763browse

The zip class that comes with the CI framework is simple and practical. This article will briefly talk about the use of the zip class in the CI framework.

First you need to import the zip class:

Copy code The code is as follows:

$this->load->('zip');

In addition, considering the structure of CI, you also need to set up an automatic loading class to load the zip.
You can also load them together during setup.
If you encounter this problem, it may be that the zip class is not loaded automatically.
The specific calling method is as follows:

Copy code The code is as follows:

$path = $_SERVER['DOCUMENT_ROOT'];//The folder that needs to be compressed Path
$this->zip->read_dir($path,FALSE);//Start compressing the folder at the specified path and clear the structure inside.
$this->zip->download('my_backup.zip');//Download the compressed file.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825352.htmlTechArticleThe zip class that comes with the CI framework is simple and practical. This article will briefly talk about the use of the zip class of the CI framework. First you need to import the zip class: Copy code The code is as follows: $this-load-('zip'); In addition, but...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn