Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

filesize()

Example

Give back the size of the “test.txt” file:rephrase

<?php
echo filesize(“test.txt”);
?>

Definition and Usage

The size of a file is returned by the filesize() method.

 

Note: This function caches its output. To clear the cache, use clearstatcache().

Syntax

filesize(filename)

Parameter Values

 

Parameter

Description

filename

Essential. gives the location of the file to be checked.

Technical Details

Return Value:

If successful, the file size in bytes; if unsuccessful, FALSE

PHP Version:

4.0+