0
是否可以检查具有相同文件名(仅在文件扩展名中不同)的文件,并且只显示一次它们的名称?Scandir:检查具有相同名称的文件(不包括扩展名)
if (is_dir($dir_path)) {
$files = scandir($dir_path);
foreach($files as $file) {
if (!in_array($file, $exclude_all)) {
$path_to_file = $dir_path . $file;
$bare_name = pathinfo($path_to_file, PATHINFO_FILENAME);
$extension = pathinfo($path_to_file, PATHINFO_EXTENSION);
echo 'Path to file: ' . $path_to_file . '<br />';
echo 'Bare file name: ' . $bare_name . '<br />';
echo 'Extension: ' . $extension . '<br />';
}
}
}
是的,这是可能的。 – 2013-02-28 22:48:01
你能告诉我吗? ;) – Betsy 2013-02-28 22:49:30