How do you auto delete all files under a sub directory after x-time (let say after 24 hours) - without using a cronjob command from server or pl. How can you do this just us
$path = 'folder/subfolder/'; /* foreach (glob($path.'.txt') as $file) { */ foreach (glob($path.'*') as $file) { if(time() - filectime($file) > 86400){ unlink($file); } }