note 108445 added to function.filesize
| From: | admin at gk-root dot com | Date: | Thu, 26 Apr 2012 21:38:57 +0000 |
| Subject: | note 108445 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187367@lists.php.net to get a copy of this message | ||
<?php
function returnFileSize($fileSize) {
switch ($fileSize) :
case ($fileSize < 1024):
return $fileSize.' <b>Bit</b>';
case ($fileSize > 1024 && $fileSize < 1048576):
return round($fileSize/1024, 1).' <b>Kb</b>';
case ($fileSize > 1048576 && $fileSize < 1073741824):
return round($fileSize/1048576, 1).' <b>Mb</b>';
case ($fileSize > 1073741824 && $fileSize < 1099511627776 ):
return round($fileSize/1073741824, 1).' <b>Gb</b>';
case ($fileSize > 1099511627776 && $fileSize < 1125899906842624):
return round($fileSize/1099511627776, 1).' <b>TB</b>';
case ($fileSize > 1125899906842624):
return round($fileSize/1125899906842624, 1).' <b>PB</b>';
default:
return $fileSize;
endswitch;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 81.218.172.200
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/108445
Del: integrated -- https://master.php.net/note/delete/108445/integrated
Del: useless -- https://master.php.net/note/delete/108445/useless
Del: bad code -- https://master.php.net/note/delete/108445/bad+code
Del: spam -- https://master.php.net/note/delete/108445/spam
Del: non-english -- https://master.php.net/note/delete/108445/non-english
Del: in docs -- https://master.php.net/note/delete/108445/in+docs
Del: other reasons-- https://master.php.net/note/delete/108445
Reject -- https://master.php.net/note/reject/108445
Search -- https://master.php.net/manage/user-notes.php