note 83337 deleted from function.filesize by aidan
| From: | aidan@php.net | Date: | Wed, 15 Apr 2009 17:39:19 +0000 |
| Subject: | note 83337 deleted from function.filesize by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153358@lists.php.net to get a copy of this message | ||
Note Submitter: chris [AT] cmbuckley [DOT] co [DOT] uk
----
Slight bug in the script below, the power should be incremented after the string assignment:
<?php
do {
if (1024 > ($byte /= 1024)) {
$str = ($pow < strlen($postfixes) ? $postfixes[$pow] . 'iB' :
'× 2<sup>' . ($pow * 10) . '</sup> B');
}
$pow++;
} while ($byte >= 1024);
?>