Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
most recent dated
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Platero
#1
most recent dated
Aug 25 '06, 08:15 AM
Hi, how can I get the most recent dated file (or the last
created/modified) in a specified directory?
Thanks
Peter Münster
#2
Aug 25 '06, 08:45 AM
Re: most recent dated
On Fri, 25 Aug 2006, Platero wrote:
Hi, how can I get the most recent dated file (or the last created/modified) in
a specified directory?
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 free.fr
PM-Contact
http://pmrb.free.fr/contact/
Peter Münster *** Brittany *** France
Comment
Post
Cancel
slave4code@gmail.com
#3
Aug 25 '06, 08:45 AM
Re: most recent dated
I hope it will help you :) ->
PHP: filemtime - Manual
http://www.php.net/manual/en/function.filemtime.php
Gets file modification time
Now just write that simple algorythm : )
This is how to get file motification date
<?php
// outputs e.g. somefile.txt was last modified: December 29 2002
22:16:23.
$filename = 'somefile.txt';
if (file_exists($f ilename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.",
filemtime($file name));
}
?>
Comment
Post
Cancel
Platero
#4
Aug 25 '06, 09:05 AM
Re: most recent dated
ok! Thanks very much! :-)
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment