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

PHP filesize() Function

PHP filesize() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

The filesize() function returns the size of a specified file.

Returns the file size in bytes on success, or FALSE on failure.

Syntax

filesize(filename)

Parameters Description
filename Required. Specifies the file to check.

Tips and Notes

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


Example

The code above will output:

20


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual