使用PHP解压文件Unzip

摘要:
zip文件解压文件。

这是一个非常方便的PHP函数从。zip文件解压缩文件。它有两个参数:第一个是压缩文件的路径和第二

 1 function unzip_file($file, $destination) {
 2     // create object
 3     $zip = new ZipArchive() ;
 4     // open archive
 5     if ($zip->open($file) !== TRUE) {
 6         die ('Could not open archive');
 7     }
 8     // extract contents to destination directory
 9     $zip->extractTo($destination);
10     // close archive
11     $zip->close();
12     echo 'Archive extracted to directory';
13 }

免责声明:文章转载自《使用PHP解压文件Unzip》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇[译]AngularJS Services 获取后端数据JUnit入门下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

redis教程--phpredis

phpredis是php的一个扩展 <?php //连接本地的 Redis 服务 $redis = new Redis(); $redis->connect('127.0.0.1', 6379); echo "Connection to server sucessfully。"; //查看服务是否运行 echo "Server is runni...

PHP安装Redis扩展

记录一次中windows上给php安装redis扩展流程; 一、PHP中Redis扩展安装配置 上一张图看一下当前PHP版本信息,因为版本非常多,稍微不慎将会安装失败。 我本地是xampp集成环境, 由图可见 1、我php版本是7.1.13,所以下载php_redis.dll扩展要下载7.1版本的 2、Architecture是x86,所以redis应该选...

Redis使用

一、定义 redis是nosql产品之一,nosql就是无需编写复杂的sql语句。是Remote Dictionary Server(远程字典数据服务)的缩写。 由意大利人 antirez(Salvatore Sanfilippo)  开发的一款 内存高速缓存数据库。该软件使用C语言编写,它的数据模型为 key-value。 它支持丰富的数据结构(类型),...

PHP文本的读写

1 <?php 2 $txtPart="test0.txt"; //export 3 $txtPartContent=fopen($txtPart,"r"); //读文件,返回TRUE,FALSE 4 if($txtPartContent){ //若文件存在继续 5 while(!fe...

mac下wordpress环境搭建

mac下本来就有apache和php,只需要配置以下+安装mysql 1.Apache 预装目录在  /etc/apache2; 默认的网站目录在 /Library/WebServer/Document 要支持PhP,需要开启配置文件httpd.conf下的  #LoadModule php5_module libexec/apache2/libphp5....

zabbix安装注意以下几个部分

1. /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf [zabbix] user = nginx group = nginx listen.owner = nginx listen.group = nginx listen.mode = 0666 listen = /var/opt/rh/rh-php72/run/...