filesize() function in PHP


The filesize() function returns the file size. It returns the file size in bytes, on success, whereas on failure, it returns FALSE.

Syntax

filesize(file_path)

Parameters

  • file_path − The path of the file for which the size is to be determined.

Return

The filesize() function returns the file size in bytes, on success, whereas on failure, it returns FALSE.

Example

<?php
   echo filesize("one.txt");
?>

Output

40

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 24-Jun-2020

329 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements