filesize.php : filesize « File Directory « PHP






filesize.php

 
<?php
   $file = "data.txt";
   $bytes = filesize("$file"); 
   echo "File ".basename($file)." is $bytes bytes, or ".round($bytes / 1024, 2)." kilobytes.";
?>
  
  








Related examples in the same category

1.Determining File Size with filesize()
2.filesize() function returns the size, in bytes.