我的代码:
if ($d = opendir('.')) {
while (($file = readdir($d)) !== false) {
if ( $file != "." && $file != ".." ){
echo "filename: $file \n";
$files[]=$file;
}
}
closedir($d);
}
输出:
filename: audio_files filename: backup_files filename: compressed_files filename: database_files filename: data_files filename: developer_files filename: disk_image_files filename: executable_files filename: font_files filename: genstats.php filename: raster_image_files filename: spreadsheet_files filename: text_files filename: text_filesdesktop__dup.ini filename: video_files filename: web_files
而text_filesdesktop__dup.ini
甚至不存在。
C:\Users\Steve\Desktop\Files>del text_filesdesktop__dup.ini Could Not Find C:\Users\Steve\Desktop\Files\text_filesdesktop__dup.ini
我试过使用scandir()
,删除文件并重新创建它等,但无济于事。我根本无法让那个 .ini 文件消失。