Get information about a file:
<?php
$stat = stat("test.txt");
echo "Access time: " .$stat["atime"];
echo "<br>Modification time: " .$stat["mtime"];
echo "<br>Device number: " .$stat["dev"];
?>
Run Example »
The stat() function returns information about a file.
Note: The results from this function will differ from server to server. The array may contain the number index, the name index, or both.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
stat(
filename)
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file |
Return Value: | An array with the following elements:
It returns an E_WARNING on failure |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!