filesize

int filesize(string filename) 

Retrieves file size.

Returns:

Size of file; FALSE on error

Description:

Returns the size of the specified file in bytes.

Note:

The results of this function are cached. See clearstatcache() for details.

Example:

Print file size
$filesize = filesize("myfile"); 
echo ($filesize); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.