php的zip解壓縮類pclzip使用樣本

來源:互聯網
上載者:User

 PclZip是一個很強大的壓縮與解壓縮zip檔案的PHP類,這篇文章主要介紹了PclZip的使用方法

PclZip簡介PclZip是一個很強大的壓縮與解壓縮zip檔案的PHP類,PclZip library能夠壓縮與解壓縮Zip格式的壓縮檔(WinZip、PKZIP);且能對此類類檔案進行處理,包括產生壓縮檔、列出壓縮檔的內容以及解壓縮檔案等等。 簡單、易用、強大是我對它的評價。 最近在開發我的Wordpress外掛程式ShareLink,在這過程中,發現了PclZip這個操作zip檔案的PHP類,不得不推薦下。 還有另外一個推薦的原因就是在它的源碼裡面讓我發現了一個PHP函數參數的淫蕩用法。下面將舉例說明。 產生zip檔案用法一:  代碼如下:< ?phpinclude_once('pclzip.lib.php');$archive = new PclZip('archive.zip');$v_list = $archive->create('file.txt,data/text.txt,folder');if ($v_list == 0) {    die("Error : ".$archive->errorInfo(true));}?>  用法二: 代碼如下:< ?phpinclude_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));}?> 
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.