note 109312 deleted from function.disk-total-space by danbrown
| From: | danbrown@php.net | Date: | Mon, 16 Jul 2012 15:48:09 +0000 |
| Subject: | note 109312 deleted from function.disk-total-space by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189227@lists.php.net to get a copy of this message | ||
Note Submitter: blog [at] buzut [dot] fr
----
I really loved stierguy1's function for its simplicity and powerfullness. But one thing just
anoys me here, none of these functions provide size in octets units. As it's more used than
bits, at least here in France, i just post my tiny modifications which allow to have octets based
sizes.
<?php
function roundsize($size)
{
$i=0;
$iec = array("O", "Ko", "Mo", "Go", "To");
while (($size/1000)>1)
{
$size = $size/1000;
$i++;
}
return(round($size,1)." ".$iec[$i]);
}