Re: [PHP] spl DirectoryIterator

2007-04-08 Thread Jochem Maas
Matthew Dellar wrote: I have a problem, I need to turn an iterator into an array, but when I do, some methods I need to use stop working. why do you need to turn it into an array? maybe there is an alternative? my first reaction would be that if you really need an array then you'll probably

[PHP] spl DirectoryIterator

2007-04-07 Thread Matthew Dellar
I have a problem, I need to turn an iterator into an array, but when I do, some methods I need to use stop working. Take a look at the following example: $dir = 'c:/'; $files = new DirectoryIterator($dir); //$files = iterator_to_array($files); foreach ($files as $file) { echo

[PHP] SPL DirectoryIterator

2005-01-28 Thread Chris
I'm not sure if this is a feature request, a Oh, I didn't know that, or That's the way it is, deal with it kind of problem. foreach(new DirectoryIterator($sDir) as $oFile) { if($oFile-isDot() || 'hidden.txt' == $oFile-getFilename()) continue; echo $oFile,\n; } In the code above, I am

Re: [PHP] SPL DirectoryIterator

2005-01-28 Thread Jochem Maas
Chris wrote: I'm not sure if this is a feature request, a Oh, I didn't know that, or That's the way it is, deal with it kind of problem. iMHO its pretty much the last one, but I don't see the problem with what you have written, ok its a little longer, but you don't have to know that the magic