This seems like a supid question but how do you get a file's last modified date? I see the function filemtime() to get the last modified time but where is the filemdate()?
PHP.net explains how to use filemtime() to display the file modified date.
*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
filemtime() returns a value which includes the time and date. And the online manual page for filemtime() has example code for how to get what you need out of the returned value.
This page was last updated on
<?php
$last_modified = filemtime("index.php");
print(date("F jS Y", $last_modified));
echo(" at ");
print(date("g:i a", $last_modified));
?>
If you need to port this code over to another file, you'd just change the reference to the file name.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.