Home  >  Article  >  Backend Development  >  How to use the stat function

How to use the stat function

藏色散人
藏色散人Original
2019-02-15 11:55:384099browse

php stat() function is used to give file information.

How to use the stat function

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn