Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP stat() Function

PHP stat() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

The stat() function returns information about a file.

This function returns an array containing the following elements:

Syntax

stat(

filename

)

Parameters Description
filename Required. Specifies the path of the file.

Tips and Notes

**Note:** The results returned by this function differ from server to server. This array contains numeric indices, named indices, or both.

**Note:** The results of this function are cached. Use clearstatcache() to clear the cache.


Example

Modification time: ' .$stat['mtime']; echo '
Device number: ' .$stat['dev']; ?>

The code above will output:

Access time: 1141633430

Modification time: 1141298003

Device number: 0


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual