search
Homephp教程php手册php中PclZip插件文件解压与压缩文件

最近在开发我的Wordpress插件ShareLink,在这过程中,发现了PclZip这个操作zip文件的PHP类,不得不推荐下,还有另外一个推荐的原因就是在它的源码里面让我发现了一个PHP函数参数的淫荡用法,下面将举例说明.

生成zip文件,用法一,代码如下:

<?php 
	 
	include_once(&#39;pclzip.lib.php&#39;); 
	 
	$archive = new PclZip(&#39;archive.zip&#39;); 
	//开源代码phprm.com 
	$v_list = $archive->create(&#39;file.txt,data/text.txt,folder&#39;); 
	 
	if ($v_list == 0) { 
	 
	die("Error : ".$archive->errorInfo(true)); 
	 
	} 
	 
	 

用法二,代码如下:

<?php 
	 
	include_once(&#39;pclzip.lib.php&#39;); 
	 
	$archive = new PclZip(&#39;archive.zip&#39;); 
	 
	$v_list = $archive->create(&#39;data/file.txt,data/text.txt&#39;, 
	 
	PCLZIP_OPT_REMOVE_PATH, &#39;data&#39;, 
	 
	PCLZIP_OPT_ADD_PATH, &#39;install&#39;); 
	 
	if ($v_list == 0) { 
	 
	die("Error : ".$archive->errorInfo(true)); 
	 
	} 
	 
	 

看见create方法的参数没有,再看看方法原型你就知道如何了,至少我还没有这样用过.

教程网址:

欢迎收藏∩_∩但请保留本文链接。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!