在PHP中的filectime()函数

PHPz
PHPz 转载
2023-09-08 22:25:02 1047浏览

在PHP中的filectime()函数

filectime() 函数返回文件的最后更改时间。它将文件的最后更改时间作为 UNIX 时间戳返回,失败时返回 false。

语法

filectime ( file_path );

参数

  • file_path - 将找到最后更改时间的文件的路径。

返回

filectime() 函数以 UNIX 时间戳形式返回文件的最后更改时间,失败时返回 false。

示例

<?php
   echo filectime("info.txt");
?>

输出

19346322544

现在让我们以人类可读形式的日期形式获取文件的上次更改时间。

示例 h2>

现场演示

<?php
   echo "Last change time of the file: ".date("F d Y H:i:s.",filectime("info.txt"));
?>

输出

Last change time of the file: September 23 2018 08:12:42

以上就是在PHP中的filectime()函数的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除