最近在开发我的Wordpress插件ShareLink,在这过程中,发现了PclZip这个操作zip文件的PHP类,不得不推荐下,还有另外一个推荐的原因就是在它的源码里面让我发现了一个PHP函数参数的淫荡用法,下面将举例说明.
生成zip文件,用法一,代码如下:
<?php include_once('pclzip.lib.php'); $archive = new PclZip('archive.zip'); //开源代码phprm.com $v_list = $archive->create('file.txt,data/text.txt,folder'); if ($v_list == 0) { die("Error : ".$archive->errorInfo(true)); }
用法二,代码如下:
<?php include_once('pclzip.lib.php'); $archive = new PclZip('archive.zip'); $v_list = $archive->create('data/file.txt,data/text.txt', PCLZIP_OPT_REMOVE_PATH, 'data', PCLZIP_OPT_ADD_PATH, 'install'); 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
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
4 weeks agoByDDD
R.E.P.O. Save File Location: Where Is It & How to Protect It?
4 weeks agoByDDD
Two Point Museum: All Exhibits And Where To Find Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

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
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 English version
Recommended: Win version, supports code prompts!
