我们可以使用RecursiveDirectoryIterator 和 RecursiveIteratorIterator删除目录和子目录及文件,子目录将先与父目录删除 [pre]
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(d:\update\tt): Failed to open directory: No such file or directory in /www/wwwroot/www.aieok.com/public/static_html/article/share/51.html:12 Stack trace: #0 /www/wwwroot/www.aieok.com/public/static_html/article/share/51.html(12): RecursiveDirectoryIterator->__construct() #1 /www/wwwroot/www.aieok.com/public/static_html/article/share/51.html(23): cleanup_directory() #2 /www/wwwroot/www.aieok.com/public/index.php(26): include('...') #3 {main} thrown in /www/wwwroot/www.aieok.com/public/static_html/article/share/51.html on line 12