字节怎样转化为kb?

flyonet 2004-02-02 02:59:40
字节怎样转化为kb?
拜托各位
...全文
230 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
countstars 2004-02-02
  • 打赏
  • 举报
回复
Then?PHP有Then?
function Get_File_Size($filesize) {
if($filesize < 1024){
$filesize = (string)$filesize . " Bytes";
}else if($filesize < (1024 * 1024)){
$filesize = number_format((double)($filesize / 1024), 1) . " KB";
}else if($filesize < (1024 * 1024 * 1024)){
$filesize = number_format((double)($filesize / (1024 * 1024)), 1) . " MB";
}else{
$filesize = number_format((double)($filesize / (1024 * 1024 * 1024)), 1) . " GB";
}
return $filesize;
}
x_gn 2004-02-02
  • 打赏
  • 举报
回复
If thing.Size <1024 Then
str= thing.Size & " Bytes"
ElseIf thing.Size < 1048576 Then
str= Round(thing.Size / 1024.1) & " KB"
Else
str= Round((thing.Size/1024)/1024.1) & " MB"
End If
flyonet 2004-02-02
  • 打赏
  • 举报
回复
对?
上传后得到的不是字节吗?
我想把它转换为多少kb。
ashchen 2004-02-02
  • 打赏
  • 举报
回复
1024?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧