获取 zip 文件夹中 pdf 的数量
$zip = new ZipArchive;
if ($zip->open($path) === TRUE) {
$count = 0;
for ($i = 0; $i < $zip->numFiles; $i++) {
$stat = $zip->statIndex($i);
$fileName = basename($stat['name']);
if (strtolower(pathinfo($fileName, PATHINFO_EXTENSION)) === 'pdf'
&& strpos($fileName, '._') === false) {
$count++;
}
}
$zip->close();
return $count;
} else {
return 0;
}