Home > Article > Backend Development > What is the difference between the php filectime() function and the filemtime() function?
fileatime() FunctionReturns the last access time of the specified file.
This function returns the time when the file was last accessed. Returns false if an error occurs. The time is returned in Unix timestamp format.
filectime() function returns the last inode modification time of the specified file.
This function returns the time when the last inode of the file was modified. Returns false if an error occurs. The time is returned as a Unix timestamp.
filectime refers to when the file was created, filemtime is the time when the file was last modified, it’s that simple
<?php $file="F:/software/test.txt"; echo "文件最后访问的时间是".date("Y-m-d H:i:s",fileatime($file))."<br/>"; echo "文件最后改变的时间是".date("Y-m-d H:i:s",filectime($file))."<br/>"; echo "文件最后修改的时间是".date("Y-m-d H:i:s",filemtime($file))."<br/>"; ?>
The above is the detailed content of What is the difference between the php filectime() function and the filemtime() function?. For more information, please follow other related articles on the PHP Chinese website!