this file tric will read all file name
exe, mp4, mkv, mp3, zip
lets try mp3 and zip
look all working any file can be format in size mb
all working ok enjoyyy
<?php
function d_filesize($bytes, $decimals = 2) {
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
?>
function d_filesize($bytes, $decimals = 2) {
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
?>
CChange On m/adele.mp3 to your file name
echo d_filesize(filesize('m/adele.mp3'));
?>