PHP function Get File Size
/* * @param string $file Filepath * @param int $digits Digits to display * @return string|bool Size (KB, MB, GB, TB) or boolean */ funct...

https://iskablogs.blogspot.com/2014/03/php-function-get-file-size.html
/*
* @param string $file Filepath
* @param int $digits Digits to display
* @return string|bool Size (KB, MB, GB, TB) or boolean
*/
function getFilesize($file,$digits = 2) {
if (is_file($file)) {
$filePath = $file;
if (!realpath($filePath)) {
$filePath = $_SERVER["DOCUMENT_ROOT"].$filePath;
}
$fileSize = filesize($
* @param string $file Filepath
* @param int $digits Digits to display
* @return string|bool Size (KB, MB, GB, TB) or boolean
*/
function getFilesize($file,$digits = 2) {
if (is_file($file)) {
$filePath = $file;
if (!realpath($filePath)) {
$filePath = $_SERVER["DOCUMENT_ROOT"].$filePath;
}
$fileSize = filesize($