note 30813 deleted from function.filesize by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 01 Sep 2004 17:32:41 +0000 |
| Subject: | note 30813 deleted from function.filesize by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75879@lists.php.net to get a copy of this message | ||
Note Submitter: dave at birko dot cjb dot net
----
I saw some filesize -> human readable "translation routines" here...
Well, check this out, php-"coders" ;)
See ya.
function fsize($file) {
$a = array("B", "KB", "MB", "GB", "TB",
"PB");
$pos = 0;
$size = filesize($file);
while ($size >= 1024) {
$size /= 1024;
$pos++;
}
return round($size,2)." ".$a[$pos];
}