directory listing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wallabee
Forum Newbie
Posts: 20
Joined: Mon Apr 21, 2003 10:01 pm

directory listing

Post by wallabee »

i've been poking around the search on this forum for some time and can't seem to find the answer to my question.

i want to be able to output a list of the sub-directories within the directory i'm currently in, so that the user can click on said subdirectory, have a displayed list of text files, and then they'll be allowed to edit the text files.

can someone point me in the correct direction for the function which would perhaps count the number of subdirectories in the current directory, allowing for a for loop to go through and use another function that would return the name of the subdirectory? is this even possible, or am i stuck just hardcoding the names of the subdirectories in?

-ben
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

for a start

Post by phpScott »

What you want to do is very possible:
Try starting here http://www.php.net/manual/en/function.readdir.php

on how to open and read directories.

phpScott
Post Reply