How PHP uses the fstat () and stat () functions
This article mainly shows you "PHP how to use fstat () and stat () function", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "PHP how to use fstat () and stat () function" this article.
Fstat () and stat ()
⑴, fstat ()-get file information through the open file pointer
Array fstat (resource $handle) / / gets the statistics of the files opened by the file pointer handle. This function is similar to the stat () function, except that it acts on an open file pointer rather than a file name.
Parameter: the handle file system pointer, which is a resource (resource) typically created by fopen ().
Return value: returns an array with statistics for the file. The format of the array is detailed in the stat () page of the manual.
⑵, stat ()-give information about the file
Array stat (string $filename) / / gets the statistics for the file specified by filename. If filename is a symbolic link, the statistics are about the connected file itself, not the symbolic link. / / lstat () is the same as stat (), except that it returns the status of symbolic connections.
Parameter: the path to the filename file.
$path = 'dPHP PHP test.txt accountabilityFP = fopen ("d:/test/test.txt", "r"); $fstat = fstat ($fp); fclose ($fp); var_dump ($fstat); above is all the content of the article "how PHP uses the fstat () and stat () functions". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!