note 106935 added to function.filesize
| From: | yatsynych at gmail dot com | Date: | Mon, 19 Dec 2011 18:13:28 +0000 |
| Subject: | note 106935 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185143@lists.php.net to get a copy of this message | ||
<?php
function _format_bytes($a_bytes)
{
if ($a_bytes < 1024) {
return $a_bytes .' B';
} elseif ($a_bytes < 1048576) {
return round($a_bytes / 1024, 2) .' KiB';
} elseif ($a_bytes < 1073741824) {
return round($a_bytes / 1048576, 2) . ' MiB';
} elseif ($a_bytes < 1099511627776) {
return round($a_bytes / 1073741824, 2) . ' GiB';
} elseif ($a_bytes < 1125899906842624) {
return round($a_bytes / 1099511627776, 2) .' TiB';
} elseif ($a_bytes < 1152921504606846976) {
return round($a_bytes / 1125899906842624, 2) .' PiB';
} elseif ($a_bytes < 1180591620717411303424) {
return round($a_bytes / 1152921504606846976, 2) .' EiB';
} elseif ($a_bytes < 1208925819614629174706176) {
return round($a_bytes / 1180591620717411303424, 2) .' ZiB';
} else {
return round($a_bytes / 1208925819614629174706176, 2) .' YiB';
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 194.44.211.198
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/106935
Del: integrated -- https://master.php.net/note/delete/106935/integrated
Del: useless -- https://master.php.net/note/delete/106935/useless
Del: bad code -- https://master.php.net/note/delete/106935/bad+code
Del: spam -- https://master.php.net/note/delete/106935/spam
Del: non-english -- https://master.php.net/note/delete/106935/non-english
Del: in docs -- https://master.php.net/note/delete/106935/in+docs
Del: other reasons-- https://master.php.net/note/delete/106935
Reject -- https://master.php.net/note/reject/106935
Search -- https://master.php.net/manage/user-notes.php