<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_52685"> 把文件字节B转化为KB,MB,GB,TB <div class="blockcode"> <div id="code_Piw"><ol> <li>function format_bytes($size,$r) {</li> <li>$units = array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");</li> <li>for ($i = 0; $size >= 1024 && $i < 4; $i ) $size /= 1024;</li> <li>return round($size,$r).$units[$i];</li> <li>} </li> <li>//$r为小数点后位数</li> </ol></div> <em onclick="copycode($('code_Piw'));">复制代码</em> </div> </td></tr></table> <div id="comment_52685" class="cm"> </div> <div id="post_rate_div_52685"></div> <br><br>