PHP filectime() Function
In this chapter you will learn:
- Definition for PHP filectime() Function
- Syntax for PHP filectime() Function
- Parameter for PHP filectime() Function
- Note for PHP filectime() Function
- Return for PHP filectime() Function
- Example - Get the last change time for a file
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/* j av a 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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP filegroup() Function
- Syntax for PHP filegroup() Function
- Parameter for PHP filegroup() Function
- Return for PHP filegroup() Function
- Note for PHP filegroup() Function
- Example - Get the file group information
Home » PHP Tutorial » PHP File Functions