pugboy Posted July 5, 2008 Share Posted July 5, 2008 I am trying to find a way to list all of the folders within a directory (or rather put them in an array) How would I go about doing this? I have searched for a function, and have come up with nothing EDIT: Scan dir seems what I want... Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 5, 2008 Share Posted July 5, 2008 $handler = opendir($directory); // keep going until all files in directory have been read while ($file = readdir($handler)) { if(is_dir($file)) { ... do your stuff } } EDIT: YesI got that of google: "php, list directory files" - and of php.net documentation on files - ctrl + f "dir"........ check out the documentation there theres a large list of functiosn tha will help you. Quote Link to comment Share on other sites More sharing options...
pugboy Posted July 5, 2008 Author Share Posted July 5, 2008 I did find a function off of the doc, but it didn't work... Thanks though, I will try your code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.