How to get the size of a file in PHP

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');  

Please Share us:
Please rate this snippet

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

Leave a Reply