Home > 类库下载 > PHP类库 > php decompress rar file php package zip file source code php_rar.dll pclzip example

php decompress rar file php package zip file source code php_rar.dll pclzip example

高洛峰
Release: 2016-10-14 10:32:55
Original
1498 people have browsed it

define('ROOT_DIR','D:/web/');
  
$rar = '2012051008.rar';
$rar_name = basename($rar,'.rar');
  
$rar_file = rar_open(ROOT_DIR.$rar) or die("失败");
$entries = rar_list($rar_file);
$arr_name = array();
foreach($entries as $entry){
    $name = $entry->getName();
    if(substr($name,-4) == '.txt') {
        $entry->extract(ROOT_DIR);
        $arr_name[] = $name;
    }  
}
rar_close($rar_file);
  
$arr_name = array('2012051008.txt','说明.txt');
$file = ROOT_DIR.$rar_name.'.zip';
require('./pclzip.lib.php');
$zip = new pclzip($file);
$list = $zip->create($arr_name);
if($list != 0) {
    foreach($arr_name as $key=>$val) {
        unlink(ROOT_DIR.$val);
    }
}
Copy after login

php decompress rar file php package zip file source code php_rar.dll pclzip example

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template