dylandcor Posted March 20, 2009 Share Posted March 20, 2009 I have a folder of Word Documents that are updated weekly. There are 2 documents changed per week. I want to get the last two updated so that all I have to do is upload new ones to change the links to them. Each set of 2 contains one LeaderMMDDYY.doc and one MemberMMDDYY.doc where MMDDYY is the date for that week. Is there any way to do this so I get the latest Leader and Member document? Any help would be appreciated. This is what I tried: $getLastModDir = filemtime("documents/agendas/"); $getLastModDir_output -= 24 * 60 * 60 * 1; Link to comment https://forums.phpfreaks.com/topic/150397-solved-get-last-two-updated-files/ Share on other sites More sharing options...
Ninjakreborn Posted March 21, 2009 Share Posted March 21, 2009 * Cycle through all of the files. * http://www.totallyphp.co.uk/code/date_file_last_modified.htm <- Use that on each file. * Put them in an array as you go. * Sort the array by time. * Grab the last 2 that were updated. * Get the file information and your done. Link to comment https://forums.phpfreaks.com/topic/150397-solved-get-last-two-updated-files/#findComment-790017 Share on other sites More sharing options...
dylandcor Posted March 21, 2009 Author Share Posted March 21, 2009 Thank you for the reply. Problem solved! Link to comment https://forums.phpfreaks.com/topic/150397-solved-get-last-two-updated-files/#findComment-790067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.