note 98250 added to features.file-upload

From: Date: Fri, 04 Jun 2010 00:10:30 +0000
Subject: note 98250 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-169876@lists.php.net to get a copy of this message
In reply to "info at levaravel dot com", that method would be inaccurate and slow, here is a much cleaner and faster implementation of the same functionality that rounds to two decimal points. <?PHP function GetHRSize($size) { $sizes = array('B', 'KiB', 'MiB', 'GiB', 'TiB'); while($size > 1024) { array_shift($sizes); $size *= 0.0009765625; /* mul is faster then div: 1.0 / 1024 */ } return number_format($size, 2) . array_shift($sizes); } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 115.70.93.107 ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- https://master.php.net/note/edit/98250 Del: integrated -- https://master.php.net/note/delete/98250/integrated Del: useless -- https://master.php.net/note/delete/98250/useless Del: bad code -- https://master.php.net/note/delete/98250/bad+code Del: spam -- https://master.php.net/note/delete/98250/spam Del: non-english -- https://master.php.net/note/delete/98250/non-english Del: in docs -- https://master.php.net/note/delete/98250/in+docs Del: other reasons-- https://master.php.net/note/delete/98250 Reject -- https://master.php.net/note/reject/98250 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169876) next »