$file_size = 123456789; // bytes $formatted_size = format_size($file_size); echo "The size of the file is: " . $formatted_size;
The size of the file is: 117.74 MBThis function is available in the PHP built-in function library and does not require any special packages or libraries to be installed.