In this article, you will learn about a similar function to stat() but the only difference is that stat() function does not require the file to be opened.
The fstat() function returns the information about a file in PHP. The information may differ depending on the server. Possible information contains the number index or name index, or both of these.
what is the syntax of the FSTAT function in php?
fstat(file)
Parameter | Description |
---|---|
file | Required. Specifies the open file to check |
examples of the FSTAT function
Example 1. In this example, we return information about the open file.
<?php
$file = fopen("test.txt","r");
print_r(fstat($file));
fclose($file);
?>