Simple question – simple answer:
How do I delete all files in a directory with PHP?
$files = glob(’/path/to/directory/*.*’);
foreach($files as $file)
unlink($file);
Simple question – simple answer:
How do I delete all files in a directory with PHP?
$files = glob(’/path/to/directory/*.*’);
foreach($files as $file)
unlink($file);
© 2009 Freelancer Martin Zeller. All Rights Reserved.
This blog is powered by Wordpress and Magatheme by Bryan Helmig.
PHP – Delete files by pattern | Freelancer Martin Zeller - php asp.net java c# .net c++ xhtml seo magento zend framework coremedia dotnetnuke telerik
on Mrz 8th, 2010
@ 10:49:
[...] this method you can also delete all files of a directory – with pattern [...]