PHP fstat() Function

PHP ftell() Function
PHP fseek() Function

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)
ParameterDescription
fileRequired. Specifies the open file to check
PHP fstat() method

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);
?>

PHP ftell() Function
PHP fseek() Function
en English
X
Scroll to Top