0
這是我的代碼解壓縮文件,它正在工作。解壓縮後如何獲取解壓縮文件夾名稱。像zip文件名是'demo65856.zip',解壓文件夾名是'demo'。 感謝解壓後獲取文件夾名稱的名稱
if(isset($_POST['submit'])){
WP_Filesystem();
$destination = wp_upload_dir();
$normal_path = $path_array;
$filename = $result->theme_file_name;
$link_filename = substr($filename, 0, -4);
$destination_path = $destination['basedir'].'/theme/';
$demo_link = $destination['baseurl'].'/theme/'.$link_filename;
$unzipfile = unzip_file($destination_path.$filename, $destination_path);
if ($unzipfile) {
echo '<h3> <a href="'.$demo_link.'">demo link has created</a></h3>';
} else {
echo 'There was an error unzipping the file.';
}
}
可以在我的代碼中實現您的代碼? – fiyan