php stat() function is used to give file information.
php stat() function Syntax
Function: Return information about the file.
Syntax:
stat(file)
Parameters:
file Required. Specifies the documents to be checked.
Description: Get the statistical information of the file specified by file. If file is a symbolic link, the statistics are about the connected file itself, not the symbolic link. If an error occurs, stat() returns false and issues a warning.
php stat() function example
<?php $file = stat("./test.txt"); print_r($file); ?>
This article is an introduction to the PHP stat function. I hope it will be helpful to friends in need!
The above is the detailed content of How to use the stat function. For more information, please follow other related articles on the PHP Chinese website!