$dirname = "c:/document_archive"; $dir = opendir($dirname); while ($filename = readdir($dir)) { $fullpath = "$dirname/$filename"; if (is_dir($fullpath)) continue; $stat = stat($fullpath); $size = $stat[7]; $parts = explode('_', $filename); echo $parts[0] . "\r\n"; echo $parts[1] . "\r\n"; echo $parts[2] . "\r\n"; echo $parts[3] . "\r\n"; echo $parts[4] . "\r\n"; echo $parts[5] . "\r\n"; echo $size; }