note 40837 added to ref.filesystem
| From: | ken at xzone9 dot com | Date: | Tue, 16 Mar 2004 17:46:58 +0000 |
| Subject: | note 40837 added to ref.filesystem | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66921@lists.php.net to get a copy of this message | ||
The following will work on UNIX (from peeweeks code submitted for "Windows")---
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 = "/home/mypath/";
ls($startpath);
----
Manual Page -- http://www.php.net/manual/en/ref.filesystem.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40837
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40837&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40837&report=yes
Search -- http://master.php.net/manage/user-notes.php