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 of the ci framework. Friends who need it can refer to
The zip class that comes with the CI framework is simple and practical. This article Let’s briefly talk about the use of the zip class of the CI framework.
First you need to import the zip class:
$this->load->('zip');
In addition, considering the structure of CI, you also need to set up the automatic loading class and load the zip into it.
Alsocan be loaded uniformlyduring setting.
If you encounter this problem, it may be that the zip class is not loaded automatically.
The specific calling method is as follows:
$path = $_SERVER['DOCUMENT_ROOT'];//需要压缩的文件夹路径 $this->zip->read_dir($path,FALSE);//开始压缩指定路径的文件夹,清除里面的结构。 $this->zip->download('my_backup.zip');//下载压缩后的的文件。
The above is the entire content of this article. I hope it will be helpful to everyone's learning. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
SWFUpload plug-in upload file code
##
The above is the detailed content of Use of zip class in CI framework. For more information, please follow other related articles on the PHP Chinese website!