Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

log php


For those interested. Works with older than 4.3 versions.

<?php
    function byteConvert($bytes)
    {
        $s = array('B', 'Kb', 'MB', 'GB', 'TB', 'PB');
        $e = floor(log($bytes)/log(1024));
      
        return sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));
    }
?>

Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #log #php
ADD COMMENT
Topic
Name
3+6 =