The Little Guy Posted January 10, 2007 Share Posted January 10, 2007 Anyone know how I could list all the directories in a specific directory? I then want all their sub directories, and sub directories of the sub directories, and so on.I want this as the root directory:[b][color=red]$_SERVER['DOCUMENT_ROOT'].'/users/'.$_SESSION['user'];[/color][/b] Link to comment https://forums.phpfreaks.com/topic/33614-get-directories/ Share on other sites More sharing options...
Orio Posted January 10, 2007 Share Posted January 10, 2007 And how do you want to get the info, in a one big multi-dimensional array? Or maybe just a list with all of the dirs names?Orio. Link to comment https://forums.phpfreaks.com/topic/33614-get-directories/#findComment-157543 Share on other sites More sharing options...
The Little Guy Posted January 10, 2007 Author Share Posted January 10, 2007 I would like to get it any way possible, the faster the better, and the easier to manage the better.Basically it will be used for users to look at all the folders they currently own, and delete the ones they don't want. So that means there will be two pages, one for the displaying, and one for the deleting.I currently have this, but it doesn't work, it only works for certain directories, which I didn't understand, so... yeh...[code]<?php$dir = $_SERVER['DOCUMENT_ROOT'].'/users/'.$_SESSION['user'];$files = scandir($dir, 1);foreach($files as $file){ if(is_dir($file) && $file != '.' && $file != '..'){ echo '<strong class="bigger">'.$file.'</strong>'; }}?>[/code] Link to comment https://forums.phpfreaks.com/topic/33614-get-directories/#findComment-157569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.