Reply to Re: [PHP] Strange is_dir() behavior

Your name:

Reply:


Posted by Marcos Mendonηa on 06/25/05 18:54

Yes, if i try to to echo the variable $entry outside the if is returns
the expected directories list.

I tried giving it the full path and it still doesn't work.

On 6/25/05, Edward Vermillion <evermillion@doggydoo.net> wrote:
>
> On Jun 25, 2005, at 8:34 AM, Marcos Mendonça wrote:
>
> > Hello
> >
> > I'm using PHP 4.3.9, under Windows XP with Apache.
> >
> > I have the following directory structure on a given app, i'm working
> > on.
> >
> > photos/
> >> folder1
> >> folder2
> >> folder3
> >> ... and so on
> >
> > I'm trying the following code to make a list of folder under photos:
> >
> > $d = dir('photos/');
> >
> > while (false !== ($entry = $d->read())) {
> > if (is_dir($entry) && $entry != '.' && $entry != '..')
> > echo $entry . "<br />";
> > }
> >
> > For some strange reason, that echoes nothing. is_dir is returning
> > false on every folder (dir)
> > under photos, except for '.' and '..' dirs. Can someone explain this?
>
> What do you get if you just echo out $entry without the if() statement?
>
> Do you get a list of the directories you'd expect?
>
>
>
> Edward Vermillion
> evermillion@doggydoo.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация