PHP filectime() Function
Definition
The filectime() function returns the last time the specified file was changed, including changes to permissions, owner, group or other metadata.
Syntax
PHP filectime() Function has the following syntax.
filectime(filename)
Parameter
Parameter | Is Required | Description |
---|---|---|
filename | Required. | File to check |
Note
The result of this function are cached. Use clearstatcache() to clear the cache.
Use the filemtime() function to return the last time the file content was changed.
Return
This function returns the last change time as a Unix timestamp on success, FALSE on failure.
Example
Get the last change time for a file
<?php/*from www . j a va 2 s . c om*/
echo filectime("test.txt");
echo "\n";
echo "Last change: ".date("F d Y H:i:s.",filectime("test.txt"));
?>
The code above generates the following result.