What is stat in PHP

In this article I am going to explain about stat function in PHP.
  • 1238

PHP stat() Function

The filesystem stat function gives information about a file.

Syntax of stat function

stat(fileName)

Parameters in stat function

It has only one parameter:

Parameter Description
fileName It specifies the path to the file.

Example of filesystem stat function

<html>

<body>

<?php

$file = stat("C:\wamp\www\Dinesh\PhpIntro.txt");

echo "Inode number".$file['ino']."</br>";

echo "Access time:".$file['atime']."</br>";

echo "Modification time:".$file['mtime']."</br>";

echo "Device number:" . $file['dev']."</br>";

echo "Size in bytes:". $file['size'];

?>

</body>

</html>


Output:

stat-php.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.