<?php
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).$unit[$i];
}
echo convert(memory_get_usage(true));
?>
标签:none
发布时间:December 31, 2013 // 分类:PHP // No Comments
<?php
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).$unit[$i];
}
echo convert(memory_get_usage(true));
?>
标签:none