note 30813 added to function.filesize
| From: | dave at birko dot cjb dot net | Date: | Mon, 31 Mar 2003 11:53:06 +0000 |
| Subject: | note 30813 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46003@lists.php.net to get a copy of this message | ||
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];
}
--
http://www.php.net/manual/en/function.filesize.php
http://master.php.net/manage/user-notes.php?action=edit+30813
http://master.php.net/manage/user-notes.php?action=delete+30813
http://master.php.net/manage/user-notes.php?action=reject+30813