---
title: "PHP ZIP解压缩"
author: "ericxu131"
date: "2009-02-12T10:35:07Z"
tags: []
slug: "php-zip"
draft: false
lastmod: "2009-02-12T10:35:07Z"
id: 327221
url: "https://ericxu131.iteye.com/blog/327221"
---

去掉php.ini里面关于zip的注释
解压到当前目录下

```java

        $filepath='d:\\a.zip';
        $zip = new ZipArchive();
        $rs = $zip->open($filepath);
        if($rs){
            $fd=explode(".",basename($filepath));
            $zip->extractTo(dirname($filepath).'/'.$fd[0]);
            $zip->close();
        }

```