To get the size of a file in PHP you can use the following snippet.
You can combine this snippet with How to convert bytes to human readable file size in PHP.

Sample PHP

$MyFileSize = filesize('fileName');  

2 thought on “How to get the size of a file in PHP”

Leave a Reply