Home > Java > javaTutorial > filectime() function in PHP

filectime() function in PHP

PHPz
Release: 2023-09-08 22:25:02
forward
1624 people have browsed it

filectime() function in PHP

The filectime() function returns the last modification time of the file. It returns the last modified time of the file as a UNIX timestamp, or false on failure.

Syntax

filectime ( file_path );
Copy after login

Parameters

  • file_path - The path to the file whose last changed time will be found.

Return

The filectime() function returns the last modified time of the file in the form of a UNIX timestamp, and returns false on failure.

Example

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

Output

19346322544

Now let’s get the last changed time of the file as a date in human readable form.

Example

Live demonstration

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

Output

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

The above is the detailed content of filectime() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
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