most recent dated

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi, how can I get the most recent dated file (or the last  
created/modified) in a specified directory?


Re: most recent dated

On Fri, 25 Aug 2006, Platero wrote:

Quoted text here. Click to load it

You can use scandir() to read all entries and filemtime() or stat() to get
the modification time of each entry.
Cheers, Peter

email: pmrb at

Re: most recent dated

I hope it will help you :) ->
Now just write that simple algorythm : )

This is how to get file motification date
// outputs e.g.  somefile.txt was last modified: December 29 2002

$filename = 'somefile.txt';
if (file_exists($filename)) {
   echo "$filename was last modified: " . date ("F d Y H:i:s.",

Re: most recent dated

ok! Thanks very much!   :-)

Site Timeline