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); } }
php解压rar文件 php打包zip文件 源码php_rar.dll pclzip示例
已抢141028个
抢已抢4621个
抢已抢7267个
抢已抢21419个
抢