note 52839 added to function.scandir
| From: | pablo dot fabregat at gmail dot com | Date: | Sat, 14 May 2005 09:46:06 +0000 |
| Subject: | note 52839 added to function.scandir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89409@lists.php.net to get a copy of this message | ||
i was triyng to do something similar to the ls -R command in linux, so, using the functions from
csaba , i could, so, using this simple lines, you'll get that result:
<?php
$directory = "."; // for the actual directory
$directories = dirList($directory, 2, 0); // this calls the csaba's function dirlist, wich has
type 2(files) and level 0($path and all subdirectories) as parameters. And it will return an array
with all the returned paths
//so i cross all over the array doing an echo for every single item of the array
foreach ($directories as $dir){
echo $dir."<br>";
}
?>
and that's it, remember that you need the functions listed above from csaba to use this
----
Manual Page -- http://www.php.net/manual/en/function.scandir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52839
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52839&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52839&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52839&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52839&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52839&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52839&report=yes
Search -- http://master.php.net/manage/user-notes.php