Re: code quest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, the quest thus far:
<html>
<head>
<TITLE>php experimental page</TITLE>
<style TYPE="text/css">
body { margin-left: 5%; margin-right: 5%; }
A:link, A:visited,  A:active { text-decoration:none; }
A:hover { text-decoration:underline; }
</style>
</head>
<BODY text="000000" bgcolor="FFFFFF">
<h2 align="center">Subdirectory listing experimental menuing page</h1><P>
<ul>
<?php
$ls = scandir(dirname(__FILE__));
foreach ($ls as $d) {
   if (is_dir($d) && $d != '.' && $d != '..') {
       echo '<li><a href="'.$d.'">'.$d.'</a><br/>'.PHP_EOL;
   }
}
?>
</ul>
<P>
&nbsp;
</body>
</html>
The results may be seen on this page:
   http://www.howlermonkey.net/dirlisting.php
Can this be improved to exclude anything with a '.' or a '-' in it's name? This will exclude the smileys and cgi-bin and such. If it can be persuaded to read a 1 line description from each subdirectory it could then use THAT as the text in the link, instead of the name. This could be useful in many settings.

Daniel P. Brown wrote:
On Fri, Nov 26, 2010 at 19:03, Kirk Bailey <kbailey@xxxxxxxxxxxxxxxx> wrote:
I need a routine that will return a list of every directory immediately
under the current directory- but nothing else, just a list of directories, 1
lev

Very Truly yours,
                - Kirk Bailey,
                  Largo Florida

kniht +-----+ | BOX | +-----+ think

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux