Home  >  Article  >  Backend Development  >  What is the difference between the php filectime() function and the filemtime() function?

What is the difference between the php filectime() function and the filemtime() function?

怪我咯
怪我咯Original
2017-07-11 11:20:472230browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn