note 55754 added to function.filesize

From: Date: Fri, 12 Aug 2005 10:20:38 +0000
Subject: note 55754 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-93489@lists.php.net to get a copy of this message
The second function was naturally supposed to look like this: <? function filesize_format_alt2 ($bytes) { if ( 0 > $bytes) { return $bytes; } $names = array( 'B', 'KB', 'MB', 'GB', 'TB'); $values = array( 1, 1024, 1048576, 1073741824, 1099511627776); $i = floor(log($bytes)/6.9314718055994530941723212145818); //log(1024) = 6.9314718055994530941723212145818 return number_format($bytes/$values[$i]).' '.$names[$i]; } ?> sorry ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55754 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55754&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55754&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93489) next »