PHP

Unit Options:

  • Byte (B)
  • Kilobyte (KB)
  • Megabyte (MB)
  • Gigabyte (GB)
  • Terabyte (TB)
  • Petabyte (PB)
  • Exabyte (EB)
  • Zettabyte (ZB)
  • Yottabyte (YB)

Function takes three parameter: (bytes mandatory, unit optional, decimals optional)