file size in kb php code example
Example 1: filesize in php
$file = '/path/to/your/file';
$filesize = filesize($file);
$filesize = round($filesize / 1024 / 1024, 1);
echo "The size of your file is $filesize MB.";
Example 2: filesize in php
$file = '/path/to/your/file';
$filesize = filesize($file);
$filesize = round($filesize / 1024, 2);
echo "The size of your file is $filesize KB.";
Example 3: filesize in php
$file = '/path/to/your/file';
$filesize = filesize($file);
echo "The size of your file is $filesize bytes.";