Languages: English • Reference/size format 日本語 (Add your language)
Convert a given number of bytes into a human readable format, using the largest unit the bytes will fit into.
boolean or string. False on failure. Number string on success.
<?php $size_to_display = size_format(1024);
Display the size of a file
$file_size = 1229; // filesize in bytes echo size_format($file_size, 2); // displays "1.20 kB"
size_format() is located in wp-includes/functions.php
.
Function ref links