How can the PHP `filesize` function be integrated into a script to display the file sizes of listed HTML files in a directory?
To display the file sizes of listed HTML files in a directory using the PHP `filesize` function, you can iterate through the files in the directory using functions like `scandir` or `glob`, then use the `filesize` function to get the size of each file. Finally, you can display the file sizes in a user-friendly format.
$directory = "/path/to/directory/";
$files = glob($directory . "*.html");
foreach ($files as $file) {
echo "File: " . basename($file) . " - Size: " . filesize($file) . " bytes <br>";
}