Created
June 5, 2013 09:10
-
-
Save hilyjiang/5712650 to your computer and use it in GitHub Desktop.
显示Human Recognize的存储大小
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function convert_size_val($size){ | |
$unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb'); | |
return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment