round Archives

How to check the size of a file in PHP

PHP has a handy function called filesize() which can help us display how big a file is. It does this in bytes by default, but with a bit of tinkering we can easily convert this into kilobytes or megabytes. Let’s first see how this works in bytes: $file = ‘/path/to/your/file’; $filesize = filesize($file); echo “The … Read more