Initial commit,修正
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* 转换字节数为其他单位
|
||||
* @param string $filesize 字节大小
|
||||
* @return string 返回大小
|
||||
*/
|
||||
function sizeCount($filesize){
|
||||
global $_GPC;
|
||||
global $_W;
|
||||
global $_FM;
|
||||
if ($filesize >= 1073741824) {
|
||||
$filesize = round($filesize / 1073741824 * 100) / 100 . ' GB';
|
||||
} elseif ($filesize >= 1048576) {
|
||||
$filesize = round($filesize / 1048576 * 100) / 100 . ' MB';
|
||||
} elseif ($filesize >= 1024) {
|
||||
$filesize = round($filesize / 1024 * 100) / 100 . ' KB';
|
||||
} else {
|
||||
$filesize = $filesize . ' Bytes';
|
||||
}
|
||||
return $filesize;
|
||||
}
|
||||
Reference in New Issue
Block a user