1$file = '/path/to/your/file';
2$filesize = filesize($file); // bytes
3$filesize = round($filesize / 1024 / 1024, 1); // megabytes with 1 digit
4
5echo "The size of your file is $filesize MB.";
6
1$file = '/path/to/your/file';
2$filesize = filesize($file); // bytes
3$filesize = round($filesize / 1024, 2); // kilobytes with two digits
4
5echo "The size of your file is $filesize KB.";
6
1$file = '/path/to/your/file';
2$filesize = filesize($file);
3
4echo "The size of your file is $filesize bytes.";
5