Jump to content

[SOLVED] Get Last Two Updated Files


dylandcor

Recommended Posts

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

* 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.