Separating output by line alphabetically

jonsen

New Member
I have the code below that outputs the names of files in a directory. I'd like to separate the file names alphabetically by an additional line space when the first letter of the file changes (say from A to B). Any ideas? Thanks. \[code\] $dirs = scandir("Dir"); foreach($dirs as $file) { if (($file == '.')||($file == '..')) { } elseif (is_dir($tdir.'/'.$file)) { filesInDir($tdir.'/'.$file); } else { echo $file."<br>"; } }\[/code\]
 
Back
Top