$zip = new ZipArchive;
$zip->open($uploadDir.$_FILES['zip']['name']);
$zip->extractTo($uploadDir);
$zip->close();
unlink($uploadDir.$_FILES['zip']['name']);
$dir = new DirectoryIterator($uploadDir);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
$this->db->query("INSERT INTO files(file) VALUES('{$fileinfo->getFilename()}, {$id})");
}
}
我上传了一个zip文件,我想知道php如何对这些文件进行排序?如果文件按1,2,3,4,5排序,php将按此顺序排序吗?