Note Submitter: george at REMOVE-THIScommentsville dot com
----
Much simpler script to list all directories within a given
directory, while removing the . and ..
<?php
$mydir = dir('/path/to/directory/'); //include the
trailing slash here
while(($file = $mydir->read()) !== false) {
$upper = ucwords($file);
if(is_dir($mydir->path.$file) == true &&
$file != '.' && $file != '..') {
echo "<li><strong><a
href='$file'>$upper</a></strong></li>&q
uot;;
}
}
$mydir->close();
?>
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|