View Single Post
Old 01-31-2010, 04:19 AM   #3 (permalink)
ETbyrne
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

OK, here's a sweet little function I made that does exactly what you need:

PHP Code:
function glob_recursive($dir)
{
    static 
$g = array();
    
    foreach(
glob($dir,GLOB_ONLYDIR) as $i=>$k)
    {
        
$g[] = $k;
        
glob_recursive($k.'/*');
    }
    
    return 
$g;

And use like so:

PHP Code:
print_r(glob_recursive('dingo/*')); 
The only problem is, you can't use it twice. I'll let you figure out how to fix that though.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
The Following User Says Thank You to ETbyrne For This Useful Post:
Peuplarchie (01-31-2010)