filectime()
filectime() — Gets inode change time of file.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
filectime(string $filename): int|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $filename | string | Path to the file. |
Return value
Returns the time the file was last changed, or false on failure. The time is returned as a Unix timestamp.
Example
A runnable snippet:
// outputs e.g. somefile.txt was last changed: December 29 2002 22:16:23. $filename = 'somefile.txt'; if (file_exists($filename)) { echo "$filename was last changed: " . date("F d Y H:i:s.", filectime($filename)); }
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page filectime() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.