Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

filesize

Description

The filesize of Filesystem for PHP gets file size.

Syntax

filesize(
    string $filename
): int|false

Parameters

filename

Path to the file.

Return

Returns the size of the file in bytes, or false (and generates an error of level E_WARNING) in case of an error.

NOTE: Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB.

Examples

1 · filename

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';

$return = filesize($filename);

echo $return;

?>
5
HomeMenu