Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
// encoding the torrent size
$new_torr_file_size = '.$new_torr.'; //$new_torr_filename = "torrent/".$_FILES['file']['name'];
if ($new_torr_file_size>999999){ //IF GREATER THAN 999KB, DISPLAY AS MB
$theDiv = $theFileSize / 1000000;
$new_torr_file_size = round($theDiv, 1)." MB"; //round($WhatToRound, $DecimalPlaces)
} else { //OTHERWISE DISPLAY AS KB
$theDiv = $theFileSize / 1000;
$new_torr_file_size = round($theDiv, 1)." KB"; //round($WhatToRound, $DecimalPlaces)
}
function size($size, $short_notation = false){
$kb = 1024; // Kilobyte
$mb = 1024 * $kb; // Megabyte
$gb = 1024 * $mb; // Gigabyte
$tb = 1024 * $gb; // Terabyte
if($short_notation == true){
$byte = 'B';
$kilobyte = 'KB';
$megabyte = 'MB';
$gigabyte = 'GB';
$terabyte = 'TB';
}
else{
$byte = 'bytes';
$kilobyte = 'kilobyte';
$megabyte = 'megabyte';
$gigabyte = 'gigabyte';
$terabyte = 'terabyte';
}
if ($size < $kb) $size = $size.' '.$byte;
else if ($size < $mb) $size = round($size/$kb,2).' '.$kilobyte;
else if ($size < $gb) $size = round($size/$mb,2).' '.$megabyte;
else if ($size < $tb) $size = round($size/$gb,2).' '.$gigabyte;
else $size = round($size/$tb,2).' '.$terabyte;
return $size;
}