What is the default unit of measurement for file sizes when using the PHP function Filesize()?

When using the PHP function `filesize()`, the default unit of measurement for file sizes is in bytes. This means that the function will return the size of the file in bytes, which may not be the most user-friendly format for displaying file sizes. To convert the file size to a more human-readable format (such as KB, MB, GB), you can create a function that converts the bytes to the appropriate unit of measurement.

function formatFileSize($bytes) {
    $units = array('B', 'KB', 'MB', 'GB', 'TB');

    $unit = 0;
    while ($bytes >= 1024) {
        $bytes /= 1024;
        $unit++;
    }

    return round($bytes, 2) . ' ' . $units[$unit];
}

$fileSize = filesize('example.txt');
echo formatFileSize($fileSize);