Jump to content

Point to a directory


williamrouse

Recommended Posts

Assuming I am understanding you correctly... could you use a

 

You could use readdir() (http://us3.php.net/readdir) to grab the names of all of the files/folders in the directory, and then use is_dir() (http://us3.php.net/manual/en/function.is-dir.php) to check if the name represents a folder. If so, add it to an array, and then echo out that array in the form of a

 

So, roughly, you would need to:

 

-- open the directory with opendir ()

-- read in all of the file names with readdir()

-- check through each file name, and if it represents a folder (using is_dir()) add it to an array

-- close the directory with closedir()

-- loop through the array, echoing out an option for each item in the array

 

Make sense?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...