steviez Posted February 10, 2011 Share Posted February 10, 2011 Hi, I have built a captcha system that saves the captcha to a temp folder with the file name captcha_CURRENT_TIME_STAMP where CURRENT_TIME_STAMP is the unix time. I want to delete images older than 5mins old by reading the time stamp on the file name. My question is this: How can i loop through the image folder and read the time stamps on the file name and delete all images older than 5mins? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/227302-file-delete-help/ Share on other sites More sharing options...
andyhajime Posted February 10, 2011 Share Posted February 10, 2011 Try saving the image name as a timestamp. eg: 200110112312 / YYYYMMDDHHMM. Unless you can use CRONJOB, suggest maybe each time a person visited the captcha page, do the clean up as well. Quote Link to comment https://forums.phpfreaks.com/topic/227302-file-delete-help/#findComment-1172447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.