Php File Size Code | Get File Size - Php

How to get file size using php code?

Snippet Code


  
Rate this page :
  [ 0 votes]

Here, "filesize($filename)" function is used to find the size of the file. Give the name of the file in "filename" to find the size of the desired file.

<?php $filename = 'test.txt'; echo $filename . ': ' . filesize($filename) . ' bytes'; // outputs e.g. test.txt: 1024 bytes ?>

Tags


Ask Questions

Ask Question