<?php
function list_files($dir) {
    if (!is_dir($dir)) return;
    $files = scandir($dir);
    foreach ($files as $file) {
        if ($file === '.' || $file === '..') continue;
        $path = $dir . '/' . $file;
        if (is_dir($path)) {
            list_files($path);
        } else {
            echo $path . " (" . filesize($path) . " bytes)\n";
        }
    }
}
list_files('data');
