note 62300 added to function.disk-free-space
| From: | MartinLindhe at osu1 dot php dot net | Date: | Fri, 24 Feb 2006 16:42:31 +0000 |
| Subject: | note 62300 added to function.disk-free-space | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104370@lists.php.net to get a copy of this message | ||
blow, your code is broken. it returns 1 kilobyte as "1024 bytes"
<?
function formatDataSize($bytes) {
$units = array('bytes', 'KiB', 'MiB', 'GiB',
'TiB');
foreach ($units as $unit) {
if ($bytes < 1024) break;
$bytes = round($bytes/1024, 1);
}
return $bytes.' '.$unit;
}?>
----
Server IP: 129.16.214.50
Probable Submitter: 213.100.89.163
----
Manual Page -- http://www.php.net/manual/en/function.disk-free-space.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+62300
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62300&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+62300&report=yes
Search -- http://master.php.net/manage/user-notes.php