Home > Backend Development > PHP Tutorial > 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?

怪我咯
Release: 2023-03-13 14:08:01
Original
2383 people have browsed it

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/>";   
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template