note 82186 deleted from function.ftp-rawlist by aidan

From: Date: Wed, 22 Apr 2009 22:17:17 +0000
Subject: note 82186 deleted from function.ftp-rawlist by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153597@lists.php.net to get a copy of this message
Note Submitter: Mike TUMS ---- Response to Hazem Khaled's get_size function. You missed kilobytes. <?php function get_size($size) { if ($size < 1024) { return round($size,2).' Byte'; } elseif ($size < (1024*1024)) { return round(($size/1024),2).' Kb'; } elseif ($size < (1024*1024*1024)) { return round((($size/1024)/1024),2).' Mb'; } elseif ($size < (1024*1024*1024*1024)) { return round(((($size/1024)/1024)/1024),2).' Gb'; } elseif ($size < (1024*1024*1024*1024*1024)) { return round((((($size/1024)/1024)/1024)/1024),2).' Tb'; } } ?>

« previous php.notes (#153597) next »