note 29952 added to function.filesize
| From: | pkrumins at rack1 dot php dot net | Date: | Sun, 02 Mar 2003 01:08:14 +0000 |
| Subject: | note 29952 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44716@lists.php.net to get a copy of this message | ||
here is my function or calculating filesize with a correct argument.
function size($bytes) {
$types =
Array("bytes","kilobytes","megabytes","gigabytes","terabytes");
$current = 0;
while ($bytes > 1024) {
$current++;
$bytes /= 1024;
}
return round($bytes,2)." ".$types[$current];
}
--
http://www.php.net/manual/en/function.filesize.php
http://master.php.net/manage/user-notes.php?action=edit+29952
http://master.php.net/manage/user-notes.php?action=delete+29952
http://master.php.net/manage/user-notes.php?action=reject+29952