Get last access time of "webdictionary.txt":
<?php
echo fileatime("webdictionary.txt");
echo "<br>";
echo "Last access: ".date("F d Y H:i:s.", fileatime("webdictionary.txt"));
?>
Run Example »
The fileatime() function returns the last access time of the specified file.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
Note: The atime of a file changes each time the data of a file are being read. This can decrease the performance if an application accesses a large number of files or directories. Some Unix systems have access time updates disabled to increase performance. In this case this function is useless.
fileatime(
filename)
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to check |
Return Value: | The last access time as a Unix timestamp on success, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!