John Nichel wrote:
Chris wrote:
if (is_dir($file) || ($file!=".") || ($file!="..")) continue;
That will match everything and anything, files and dot directories...
The first statement by the OP should work fine. All three will eval
to true if it is a directory, and the directory isn't . or ..
* Thus wrote Mark:
> I'm having a problem I haven't encountered before. I'm using PHP
> 4.3.4 (upgrading the 4.3.9, but humor me) on Windows.
>
> I'm using the following code snippet to try to get all the
> subdirectories of a directory into an array.
>
> $maildir=MERCURY."/MAIL";
> $handle=o
--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Tuesday 28 September 2004 03:54, Mark wrote:
>
> > With the echos above in place, I get the resource handle, and it
> > echos everything you would expect except that is_dir() fails to
> > recognize the directories.
>
> Because is_dir() expects a pa
Mark wrote:
--- John Nichel <[EMAIL PROTECTED]> wrote:
Chris wrote:
if (is_dir($file) && ($file!=".") && ($file!="..")) {
$users[]=$file;
}
It's only adding it to the array if all 3 of those are true. and
since
$file can't be both '.' and '..' at the same time, it's never
matching.
I'd d
--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Tuesday 28 September 2004 03:54, Mark wrote:
>
> > With the echos above in place, I get the resource handle, and it
> > echos everything you would expect except that is_dir() fails to
> > recognize the directories.
>
> Because is_dir() expects a pa
--- John Nichel <[EMAIL PROTECTED]> wrote:
> Chris wrote:
> >if (is_dir($file) && ($file!=".") && ($file!="..")) {
> > $users[]=$file;
> >}
> >
> > It's only adding it to the array if all 3 of those are true. and
> since
> > $file can't be both '.' and '..' at the same time, it's n
On Tuesday 28 September 2004 03:54, Mark wrote:
> With the echos above in place, I get the resource handle, and it
> echos everything you would expect except that is_dir() fails to
> recognize the directories.
Because is_dir() expects a path to the file as well, otherwise it would be
trying to l
Chris wrote:
if (is_dir($file) && ($file!=".") && ($file!="..")) {
$users[]=$file;
}
It's only adding it to the array if all 3 of those are true. and since
$file can't be both '.' and '..' at the same time, it's never matching.
I'd do something like:
if (is_dir($file) || ($file!=".") |
if (is_dir($file) && ($file!=".") && ($file!="..")) {
$users[]=$file;
}
It's only adding it to the array if all 3 of those are true. and since $file can't be
both '.' and '..' at the same time, it's never matching.
I'd do something like:
if (is_dir($file) || ($file!=".") || ($file!=".."
9 matches
Mail list logo