php打包程序(在线解压与在线打包下载源码)(1/8)
php打包程序(在线解压与在线打包下载源码)本程序支持文件下载解压与在线压缩,这样我们就查以实例在线解压与在线打包下载功能了。
php教程打包程序(在线解压与在线打包下载php教程)
本程序支持文件下载解压与在线压缩,这样我们就查以实例在线解压与在线打包下载功能了。
*/
//phpzip.class.php
class phpzip{
var $datasec, $ctrl_dir = array();
var $eof_ctrl_dir = "x50x4bx05x06x00x00x00x00";
var $old_offset = 0; var $dirs = array(".");
function get_list($zip_name) {
$zip = @php教程($zip_name, rb);
if(!$zip) return(0);
$centd = $this->readcentraldir($zip,$zip_name);
@rewind($zip);
@fseek($zip, $centd[offset]);
for ($i=0; $i<$centd[entries]; $i++)
{
$header = $this->readcentralfileheaders($zip);
$header[index] = $i;$info[filename] = $header[filename];
$info[stored_filename] = $header[stored_filename];
$info[size] = $header[size];$info[compressed_size]=$header[compressed_size];
$info[crc] = strtoupper(dechex( $header[crc] ));
$info[mtime] = $header[mtime]; $info[comment] = $header[comment];
$info[folder] = ($header[external]==0x41ff0010||$header[external]==16)?1:0;
$info[index] = $header[index];$info[status] = $header[status];
$ret[]=$info; unset($header);
}
return $ret;
}
function add($files,$compact) {
if(!is_array($files[0])) $files=array($files);
for($i=0;$files[$i];$i++){
$fn = $files[$i];
if(!in_array(dirname($fn[0]),$this->dirs))
$this->add_dir(dirname($fn[0]));
if(basename($fn[0]))
$ret[basename($fn[0])]=$this->add_file($fn[1],$fn[0],$compact);
}
return $ret;
}
本文地址:http://www.phprm.com/frame/php1005102.html
转载随意,但请附上文章地址:-)
- 上一篇: php将中文转换拼音代码(1/2)
- 下一篇: php利用模板分页程序(带demo演示);(1/3)