Unlink - file deletion
Posted: Thu Jan 27, 2005 8:02 am
Hi,
I am creating some fynamic pdf in the root folder.
I have a script that i can run manually to delete all ".pdf" files.
I would like this script to run automatically when creating the pdf. and delete the files (pdf) older than 1 hour....
How can i do this?
thanks
s
I am creating some fynamic pdf in the root folder.
I have a script that i can run manually to delete all ".pdf" files.
I would like this script to run automatically when creating the pdf. and delete the files (pdf) older than 1 hour....
How can i do this?
Code: Select all
<?php
foreach (glob("*.pdf") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
unlink($filename);
}
?>s