当前位置: 首页 互联网技术

php 远程下载zip并解压到当前目录下代码

栏目:互联网技术 作者:迅捷网络 时间:2023-03-22 23:10:25
<?php
function unzip($filePath,$path) {
    if (empty($path) || empty($filePath)) {
        return false;
    }
    $zip = new ZipArchive();
    if ($zip->open($filePath) === true) {
        $zip->extractTo($path);
        $zip->close();
        return true;
    } else {
        return false;
    }
}
copy("https://xxxx.com/file.zip","./file.zip");
$filePath='./file.zip';
$path='./';
unzip($filePath,$path);
unlink('./file.zip');


php 远程下载zip并解压到当前目录下代码

阅读:298次

我要留言

  

分类栏目