PHP Zip解压 文件在线解压缩的函数代码
作者:bea
代码如下: /********************** *@file - path to zip file *@destination - destination directory for unzipped files */ function unzip_file($file, $destination){ // create object $zip = new ZipArchive() ; // open archive if ($zip->
代码如下:
/**********************
*@file - path to zip file
*@destination - destination directory for unzipped files
*/
function unzip_file($file, $destination){
// create object
$zip = new ZipArchive() ;
// open archive
if ($zip->open($file) !== TRUE) {
die ('Could not open archive');
}
// extract contents to destination directory
$zip->extractTo($destination);
// close archive
$zip->close();
echo 'Archive extracted to directory';
}
PHP Zip压缩 在线对文件进行压缩的函数
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- php下连接ftp实现文件的上传、下载、删除文件实例代码
- PHP stristr() 函数(不区分大小写的字符串查找)
- php strstr查找字符串中是否包含某些字符的查找函数
- javascript 小型动画组件与实现代码
- php 验证码实例代码
- php trim 去除空字符的定义与语法介绍
- phpmyadmin 3.4 空密码登录的实现方法
- Discuz!下Memcache缓存实现方法
- 备份mysql数据库的php代码(一个表一个文件)
- php下将图片以二进制存入mysql数据库中并显示的实现代码
- php set_time_limit(0) 设置程序执行时间的函数
- PHP 可阅读随机字符串代码
- PHP 一个随机字符串生成代码
- PHP 循环列出目录内容的函数代码
- PHP 删除一个目录及目录下的所有文件的函数代码
- PHP JSON 数据解析代码
- PHP XML数据解析代码
- PHP 日志缩略名的创建函数代码
- PHP similar_text 字符串的相似性比较函数