trancedm
10-26-2006, 02:59 AM
Hey guys,
I have the code below and I need some help with it. I did not wrote this code so im not too sure how to edit it...
$var = (time() - filemtime("dir/$file"))/60/60/240;
if ($var > 1) unlink("dir/$file");
Basically the code above deletes a file when it reaches a certain amount of days but I can't figure out when exactly it deletes the file. I want to know so I can either increase/decrease the amount of days when the file will be deleted, im assuming it has something to do with the "filemtime" function but I can't undertand the mathematics to it so if anyone know and willing to explain it to me that would be great. :)
Any help will be greatly appreciated.
Thanks
I have the code below and I need some help with it. I did not wrote this code so im not too sure how to edit it...
$var = (time() - filemtime("dir/$file"))/60/60/240;
if ($var > 1) unlink("dir/$file");
Basically the code above deletes a file when it reaches a certain amount of days but I can't figure out when exactly it deletes the file. I want to know so I can either increase/decrease the amount of days when the file will be deleted, im assuming it has something to do with the "filemtime" function but I can't undertand the mathematics to it so if anyone know and willing to explain it to me that would be great. :)
Any help will be greatly appreciated.
Thanks