-1
解壓文件,我不知道它的內容的名稱。我需要立即打開並處理這個文件。我怎樣才能抓住它?不知道它的名字?如何獲取我剛剛解壓縮的文件。 PHP
繼承人我的代碼...
if($extension == 'ZIP' || $extension == 'zip'){
$zip = new ZipArchive;
$res = $zip->open($_FILES['my_file']['tmp_name']);
if ($res === TRUE) {
$zip->extractTo('../storage/unzipped/');
$zip->close();
// Get file, how? If I dont know the name, of the file inside the
// zip folder?
} else {
// Errors
}
}
我肯定知道如何打開該文件,如果我知道這個名字.....但在這種情況下,我不知道名字,所以我需要以某種方式得到它。 zip_entry_name()?