$fileTypes='*.png';
Posted: Wed Feb 03, 2010 4:51 pm
hi all,
im sure this is very simple, but im not to quick on php code...
how do i add more file types to the .png.
thanks in advance.
grant
im sure this is very simple, but im not to quick on php code...
how do i add more file types to the .png.
thanks in advance.
grant
Code: Select all
<?php
$expiretime=1; //expire time in minutes
$tmpFolder="stuff/";
$fileTypes='*.png';
foreach (glob($tmpFolder . $fileTypes) as $Filename) {
// Read file creation time
$FileCreationTime = filectime($Filename);
// Calculate file age in seconds
$FileAge = time() - $FileCreationTime;
// Is the file older than the given time span?
if ($FileAge > ($expiretime * 60)){
// Now do something with the olders files...
//print "The file $Filename is older than $expire_time minutes\n";
//deleting files:
unlink($Filename);
}
}
?>