如何使用PHP解压缩包

uhopenet 2005-04-22 03:58:20
使用PHP能不能将RAR、ZIP文件解压缩到某个目录下,如何做,请高手给个例程
...全文
1354 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
uhopenet 2005-05-09
  • 打赏
  • 举报
回复
up
-神仙- 2005-05-04
  • 打赏
  • 举报
回复
所有的pecl在php.net官方网站都有
vitalgg 2005-05-03
  • 打赏
  • 举报
回复
http://cn.php.net/get/pecl-5.0.4-Win32.zip/from/a/mirror
loveconan 2005-05-03
  • 打赏
  • 举报
回复
等吧,我也愁这个呢
pizzro 2005-05-02
  • 打赏
  • 举报
回复
http://www.pconline.com.cn/pcedu/empolder/wz/php/0501/543980.html
谁用过这个类阿
怎么我用过几次都不行啊

那位有PHP_zip.dll下灾啊 我还是用这个算了
pizzro 2005-05-02
  • 打赏
  • 举报
回复
那位提供 php_zip.dll 下载阿 我的php的ext目录里面没有
-神仙- 2005-04-30
  • 打赏
  • 举报
回复
zip,rar都有pecl库的
服务器不支持就没办法
uhopenet 2005-04-30
  • 打赏
  • 举报
回复
继续征集答案
vitalgg 2005-04-27
  • 打赏
  • 举报
回复
PHP5的很多功能扩展都转到 PECL 项目里了.
====
http://cn.php.net/get/pecl-5.0.4-Win32.zip/from/a/mirror

What is PECL?

PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.

The packaging and distribution system used by PECL is shared with its sister, PEAR.
uhopenet 2005-04-27
  • 打赏
  • 举报
回复
netvt(唯她(为了泡老婆,努力学习LISP))
PECL是什么?到哪里下载呢
unijune 2005-04-26
  • 打赏
  • 举报
回复
RAR是有版权的吧。ZIP是可以的。如果是虚拟主机,没这个权限,那就什么都不可能了。用tar.gz什么的
uhopenet 2005-04-26
  • 打赏
  • 举报
回复
如果服务器不是WINDOWS系统怎么办
vitalgg 2005-04-26
  • 打赏
  • 举报
回复
to:zhiin(〃稚鹰〃)
可以下载PECL
zhutimy 2005-04-26
  • 打赏
  • 举报
回复
关注
zhiin1 2005-04-26
  • 打赏
  • 举报
回复
PHP5不支持zip_open怎么办啊`````
vitalgg 2005-04-22
  • 打赏
  • 举报
回复
<?php
/* zip 文件解压程序
* Written By 唯她
* URI: http://www.m121m.net
* 需要有 php_zip.dll / php_zip.so 库支持
*/

$zipFile = "putty-src.zip";

$zip = zip_open($zipFile);

function mk_dir($dirString,$initDir="./"){
$dir = explode("/",$dirString);
if (substr($initDir,-1) != "/" && $initDir != "")
$initDir .= $initDir."/";

for($i=0;$i<count($dir)-1;$i++){
$initDir .= $dir[$i] . "/";
if(!file_exists($initDir) && count($dir) > 1) mkdir($initDir);
};
echo "创建目录: $initDir\n";
}

if ($zip) {

while ($zip_entry = zip_read($zip)) {

if (substr(zip_entry_name($zip_entry),-1) != "/" && zip_entry_open($zip, $zip_entry, "r")) {

if (!file_exists(dirname(zip_entry_name($zip_entry))))
{
mk_dir(zip_entry_name($zip_entry));
}
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
$fout = fopen(zip_entry_name($zip_entry),"w");
fwrite($fout,$buf);
echo "解压文件:".zip_entry_name($zip_entry)."\n";

zip_entry_close($zip_entry);
} else {
mk_dir(zip_entry_name($zip_entry));

}

}

zip_close($zip);

}

?>
reners 2005-04-22
  • 打赏
  • 举报
回复
http://www.pconline.com.cn/pcedu/empolder/wz/php/0501/543980.html
uhopenet 2005-04-22
  • 打赏
  • 举报
回复
服务器不允许使用exec函数怎么办
Meteorlet 2005-04-22
  • 打赏
  • 举报
回复
exec('zip somedir/somezip.zip somefile.ext');

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧