开发者

How to check if a file was modified/newer than another file using PHP?

Say I've got two dirs, foo and bar. Both have got a file 'test.php'. I'd like to c开发者_StackOverflow社区heck if the copy of test.php in bar is newer than the one in foo. How can I do this? I'm using windows XP but would prefer a cross platform solution, though if that's possible, windows only would work too.

Edit: Only need to check text files containing code, e.g: php, javascript, css, and html files. No need to check for images though if that could be checked it'd be a bonus.


Use: filemtime($filename)


filemtime should work for you.


You could try to use filemtime which should tell the last modified timestamp


Use filemtime

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜