\n"); // sort 'em sort($dirArray); /* // print 'em print("\n"); print("\n"); // loop through the array of files and print them all for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files $info = pathinfo($dirArray[$index]); if ($info['extension'] == $ext) { print(""); print(""); print(""); print("\n"); } } } */ $filestring = ''; for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files $info = pathinfo($dirArray[$index]); if ($info['extension'] == $ext) { if ($filestring == '') { $filestring = $dirArray[$index]; } else { $filestring = $filestring . ',' . $dirArray[$index]; } } } } print "fileList=".$filestring; return "fileList=".$filestring; ?>