unidox Posted July 27, 2008 Share Posted July 27, 2008 How would I go about deleting all files inside a directory, and then deleting the directory. Thanks Link to comment https://forums.phpfreaks.com/topic/116804-dir/ Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 exec('rm -r /yourdirectory')? >_> Or: foreach (glob('somedirectory/*') as $filename) { unlink("somedirectory/$filename"); } unlink ("somedirectory/"); Link to comment https://forums.phpfreaks.com/topic/116804-dir/#findComment-600664 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.