Freelancer Martin Zeller

php asp.net java c# .net c++ xml xhtml seo magento zend framework dotnetnuke tomcat iis sql server mysql oracle typo3 coremedia

PHP – Delete all files in a directory

Tags:

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);

Tags:

One Response to “PHP – Delete all files in a directory”


  1. 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 [...]

Leave a Reply

© 2009 Freelancer Martin Zeller. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.