List Info

Thread: note 72773 added to class.dir




note 72773 added to class.dir
user name
2007-01-31 20:10:09
With SPL, you could recursively list all of the folders
inside the current directory like this:

<?php
$it = new RecursiveDirectoryIterator('./');

// RecursiveIteratorIterator accepts the following modes:
//     LEAVES_ONLY = 0  (default)
//     SELF_FIRST  = 1
//     CHILD_FIRST = 2
foreach (new RecursiveIteratorIterator($it, 2) as $path) {

    if ($path->isDir()) {

        echo "$pathn";

    }

}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 72.1.217.156 (proxied: 127.0.0.1)
----
Manual Page -- http://www
.php.net/manual/en/class.dir.php
Edit        -- https://master
.php.net/note/edit/72773
Del: integrated  -- h
ttps://master.php.net/note/delete/72773/integrated
Del: useless     -- http
s://master.php.net/note/delete/72773/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/72773/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/72773/spam
Del: non-english -- 
https://master.php.net/note/delete/72773/non-english
Del: in docs     -- http
s://master.php.net/note/delete/72773/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/72773
Reject      -- https://mast
er.php.net/note/reject/72773
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )