public static function make_human_readable_filesize($bytes) {
		$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
		$num_units = count($units);
		$size = $bytes;
		foreach ($units as $i => $unit) {
			if ($size < 1024 || (($i + 1) === $num_units)) {
				return round($size, 2).$unit;
			}
			$size = $size / 1024;
		}
		return $size;
	}
public static function make_human_readable_filesize($bytes) {
		$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
		$num_units = count($units);
		$size = $bytes;
		foreach ($units as $i => $unit) {
			if ($size < 1024 || (($i + 1) === $num_units)) {
				return round($size, 2).$unit;
			}
			$size = $size / 1024;
		}
		return $size;
	}
public static function make_human_readable_filesize ( $ bytes ) { $ units = array ( 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' ) ; $ num_units = count ( $ units ) ; $ size = $ bytes ; foreach ( $ units as $ i => $ unit ) { if ( $ size < 1024 || ( ( $ i + 1 ) === $ num_units ) ) { return round ( $ size , 2 ) . $ unit ; } $ size = $ size / 1024 ; } return $ size ; }
Convert bytes into a human-readable format.

For example: $bytes = 1024 would return 1KB, $bytes = 1048576 would return 1MB, etc.

@param int $bytes The number of bytes to convert.
@return string The human readable representation of the bytes.
Convert bytes into a human - readable format .