RE: [PHP] Directory Contents Listing
| From: | Rea_David at emc dot com | Date: | Wed, 28 Nov 2001 11:38:25 +0000 |
| Subject: | RE: [PHP] Directory Contents Listing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75880@lists.php.net to get a copy of this message | ||
Here's an example code I use
<?
// print the current directory in unordered list
print("<UL>\n");
// get each entry within the directory & return to user with the
link
$myDirectory = dir(".");
while($entryName = $myDirectory->read())
{
if ($entryName != "." && $entryName != ".." &&
$entryName !=
"index.php"){
print("<LI><a href=$entryName>$entryName
\n</a>");
}
}
?>
Hope it helps!
-----Original Message-----
From: Steve Werby [mailto:steve-lists@befriend.com]
Sent: 28 November 2001 05:39
To: Deependra B. Tandukar; php-general@lists.php.net
Subject: Re: [PHP] Directory Contents Listing
"Deependra B. Tandukar" <deepndra@icimod.org.np> wrote:
> How do I display the directory contents using PHP?
See readdir() in the online manual. I'm pretty sure it even has example
code you could paste in.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net