public static function getHumanReadableBytes($value)
    {
        static $unit = array('B', 'KB', 'MB', 'GB', 'TB');

        $i = \floor(\log($value, 1024));
        $i = \min($i, 4); // Only go up to TB

        return array(
            'value' => (float) ($value / \pow(1024, $i)),
            'unit' => $unit[$i],
        );
    }
public static function getHumanReadableBytes($value)
    {
        static $unit = array('B', 'KB', 'MB', 'GB', 'TB');

        $i = \floor(\log($value, 1024));
        $i = \min($i, 4); // Only go up to TB

        return array(
            'value' => (float) ($value / \pow(1024, $i)),
            'unit' => $unit[$i],
        );
    }
public static function getHumanReadableBytes ( $ value ) { static $ unit = array ( 'B' , 'KB' , 'MB' , 'GB' , 'TB' ) ; $ i = \ floor ( \ log ( $ value , 1024 ) ) ; $ i = \ min ( $ i , 4 ) ; // Only go up to TB return array ( 'value' => ( float ) ( $ value / \ pow ( 1024 , $ i ) ) , 'unit' => $ unit [ $ i ] , ) ; }
Turns a byte value into a human-readable representation.

@param int $value Amount of bytes

@return array Human readable value and unit
Turns a byte value into a human - readable representation .