Home > php教程 > php手册 > 文件字节大小格式化

文件字节大小格式化

WBOY
Release: 2016-06-07 11:45:59
Original
1585 people have browsed it

字节格式化 把字节数格式为 B K M G T 描述的大小function byte_format($size, $dec=2){<br>     $a = array("B", "KB", "MB", "GB", "TB", "PB");<br>     $pos = 0;<br>     while ($size >= 1024) {<br>          $size /= 1024;<br>            $pos++;<br>     }<br>     return round($size,$dec)." ".$a[$pos];<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template