Check when file was last edited.

Status
Not open for further replies.

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
Hello.

Is it possible to get a PHP file to check when another file was last modified?

Note: I am using a webhost so not sure if it is or not.

Thanks.
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,484
1,486
It's the filemtime ....

PHP:
$filename = 'somefile.txt';
if (file_exists($filename)) {
    echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
 
Status
Not open for further replies.

Users who are viewing this thread

Top