Help in opendir and subdirs to read files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have this directory structure:
cache/accountcache/0
cache/accountcache/0/1
cache/accountcache/0/2
cache/accountcache/0/3
cache/accountcache/0/4
cache/accountcache/0/5
cache/accountcache/0/6
cache/accountcache/0/7
cache/accountcache/0/8
cache/accountcache/0/9

then...
cache/accountcache/1
cache/accountcache/1/1
cache/accountcache/1/2
cache/accountcache/1/3
cache/accountcache/1/4
cache/accountcache/1/5
cache/accountcache/1/6
cache/accountcache/1/7
cache/accountcache/1/8
cache/accountcache/1/9

etc...

In each subdir I have text files with this format: XXXXX_visit_counter.dat
XXXXX = It's a number

I need, starting from the cache/accountcache, read the content of each 
text file.

Tried this but doesnt work:
    $dir = "cache/accountcache";        
    if($dh = @opendir($dir)){
        while (($obj = readdir($dh))) {
            if($obj=='.' || $obj=='..') continue;
            $sub = $dir.'/'.$obj;
            echo $sub;
        }
    }













------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux