filectime() function in PHP


The filectime() function returns the last change time of a file. It returns the last change time of a file as a UNIX timestamp and returns false on failure.

Syntax

filectime ( file_path );

Parameters

  • file_path − The path of the file for which the last change time will be found.

Return

The filectime() function returns the last change time of a file as a UNIX timestamp and returns false on failure.

Example

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

Output

19346322544

Let us now get the last change time of a file as a date which is in human readable form.

Example

 Live Demo

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

Output

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

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 24-Jun-2020

64 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements