$zip = new ZipArchive;
$zip->open('download/' . $results[0]['filename']);
$i = 0;
while($name = $zip->getNameIndex($i)) {
$files[] = array(
'filename' => $name,
'compressed_size' => ???,
'uncompressed_size' => ???);
$i++;
}
$zip->close();
https://www.php.net/manual/manual/en/class.ziparchive.php,您将找到函数statIndex()
(
Https://www.php.php.net/manual/manual/en /ziparchive.statindex.php)。使用它而不是功能
getNameIndex()
。