使用 PHP 的 stat() 函数。它会返回您需要了解的所有数据。
http://php.net/manual/en/function.stat.php
<?php
/* Get file stat */
$stat = stat('C:\php\php.exe');
/*
* Print file access time, this is the same
* as calling fileatime()
*/
echo 'Access time: ' . $stat['atime'];
/*
* Print file modification time, this is the
* same as calling filemtime()
*/
echo 'Modification time: ' . $stat['mtime'];
/* Print the device number */
echo 'Device number: ' . $stat['dev'];
?>
Run Code Online (Sandbox Code Playgroud)
我认为在你的情况下“文件修改时间”就是答案。