\n"; for($i=0; $i < count($filenames); $i++) { if($filenames[$i] != 'listing.php' && !preg_match('/^\./',$filenames[$i]) && !is_dir($filenames[$i])) // don't show directories, listing.php and files that start with a dot echo "\n"; } echo "\n"; for($i=0; $i < count($filenames); $i++) { if (is_dir($filenames[$i]) && !preg_match('/^\./',$filenames[$i])) // do show directories but not files and exclude everything that starts with a dot echo "\n"; } } test(); ?>
Files
". $filenames[$i] . "
Directories
". $filenames[$i] . "