PHP filesize() function and example


 

PHP filesize() function and example

In this part of PHP tutorial we will learn about the filesize() function and its examples

In this part of PHP tutorial we will learn about the filesize() function and its examples

Syntax

  • int filesize(file_name)
  • It gives the size in bytes. 


Example of filesize() Function in PHP

<?php

    $size=filesize("c:/rose1/ram.txt");
    echo
"size is ".$size." bytes";

?>

Output
size is 20 bytes

Ads