PHP filesize() Function

❮ PHP Filesystem Reference

Example

Return the file size for "test.txt":

<?php
echo filesize("test.txt");
?>
Run Example »

Definition and Usage

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

Note: The result of this function is cached. Use clearstatcache() to clear the cache.

Syntax

filesize(filename)

Parameter Values

Parameter Description
filename Required. Specifies the path to the file to check


Technical Details

Return Value: The file size in bytes on success, FALSE on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.