Posted by comp.lang.php on 12/05/05 21:40
No I'm sorry I think you misunderstood my problem. I wound up having
it solved earlier; the problem had to do with the way I was using the
static option, which I still believe illuminates a potential PHP logic
flaw when it comes to using "static".
Phil
Sjoerd wrote:
> Why do you need this? What do you want to do? Do you want to
> recursively walk trough directories? In that case, here is an example:
>
> function traverse($dir) {
> $dh = opendir($dir);
> while ($file = readdir($dh)) {
> if ($file{0} == '.') continue;
> $path = $dir.'/'.$file;
> if (is_file($path)) {
> echo $file."\n";
> } else {
> traverse($path);
> }
> }
> closedir($dh);
> }
Navigation:
[Reply to this message]
|