What are some best practices for displaying additional information like modification date and file size while scanning directories in PHP?

When scanning directories in PHP, it's important to display additional information like modification date and file size to provide more context to the user. One way to achieve this is by using the `filemtime()` function to get the modification date and `filesize()` function to get the file size for each file in the directory.

$dir = '/path/to/directory';

$files = scandir($dir);

foreach ($files as $file) {
    if ($file != '.' && $file != '..') {
        $filePath = $dir . '/' . $file;
        $modificationDate = date('Y-m-d H:i:s', filemtime($filePath));
        $fileSize = filesize($filePath);

        echo "File: $file | Modification Date: $modificationDate | File Size: $fileSize bytes <br>";
    }
}