bd1e0d0 Posted March 28, 2006 Share Posted March 28, 2006 if($handle=opendir('.')) { while(false!==($file=readdir($handle))) { if($file!=".") { echo("$file<br />"); } } closedir($handle);} I think I'm using a generic file lister, ergo I think I'm screwed. Is there anyway through this script that I can make all the directories (folders) list first? If not, can anyone tell me a script that can? Link to comment Share on other sites More sharing options...
calvin182 Posted March 28, 2006 Share Posted March 28, 2006 I'm not sure if this helps but check out this post and give it a test, it places the directories first and then the files.http://us3.php.net/manual/en/function.readdir.php#55442 Link to comment Share on other sites More sharing options...
bd1e0d0 Posted March 28, 2006 Author Share Posted March 28, 2006 Yeah, I guess the one I was using was pretty generic. This one's better, using separate arrays for files and directories. Kind of a nice touch. Thanks, Clavin. Link to comment Share on other sites More sharing options...
calvin182 Posted March 28, 2006 Share Posted March 28, 2006 no problem! I try my best to help out. Link to comment Share on other sites More sharing options...
bd1e0d0 Posted March 28, 2006 Author Share Posted March 28, 2006 Good for you, (so do I) . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now