02Mar

PHP Delete Files Script

PHP

I needed a script to delete all files inside a folder with certain extension, a script that could be executed with just a click. So here is how i did it:
<?
{
foreach (glob(”*.txt*”) as $fn) {
unlink($fn);
}
}
header(”Location: /1″);
?>
where *.txt is the extension im looking for delete and /1 is the directory inside im placing the script. [...]

No comments | read more »