note 31931 added to ref.filesystem

From: Date: Fri, 09 May 2003 10:06:47 +0000
Subject: note 31931 added to ref.filesystem
Groups: php.notes 
Request: Send a blank email to php-notes+get-47729@lists.php.net to get a copy of this message
here is a function that recurses all directories in a Windows Tree then displays for each directory its contents. function ls ($curpath) { $dir = dir($curpath); echo("<b>$curpath</b>"); echo "<blockquote>"; while ($file = $dir->read()) { if($file != "." && $file != "..") { if (is_dir($curpath.$file)) { ls($curpath.$file."\\"); } else { echo("$file<br>"); } } } $dir->close(); echo "</blockquote>"; return; } Use: $startpath = "D:\\something\\"; ls($startpath); -- http://www.php.net/manual/en/ref.filesystem.php http://master.php.net/manage/user-notes.php?action=edit+31931 http://master.php.net/manage/user-notes.php?action=delete+31931 http://master.php.net/manage/user-notes.php?action=reject+31931

« previous php.notes (#47729) next »