Re: strangeness with is_dir()
| From: | Daniel Lundqvist | Date: | Wed, 24 Jan 2001 12:49:28 +0000 |
| Subject: | Re: strangeness with is_dir() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36404@lists.php.net to get a copy of this message | ||
On Wed, Jan 24, 2001 at 01:48:29PM +0200, hsmith@twilyt.com wrote:
> Hi all
>
> I'm trying to use is_dir to go thru a dir to list all dirs of that
>
> I have a dir with 3 other dirs in them
>
> [root@universe templates]# pwd
> /www/docs/webit/admin/templates
> [root@universe templates]# ls -l
> total 12
> drwxr-xr-x 4 root root 4096 Jan 12 13:16 1/
> drwxr-xr-x 4 root root 4096 Jan 12 13:16 2/
> drwxr-xr-x 2 root root 4096 Jan 12 13:16 CVS/
>
>
> when I run this script section it only shows the CVS ..
>
> <?
> $handle=opendir('/www/docs/webit/admin/templates');
> echo "Directory handle: $handle\n";
> echo "Files:<br>";
> while (($file = readdir($handle))!==false) {
Are you sure it should !== and not != ?
> if (is_dir($file)){
> print "$file<BR>";
> }
> }
> closedir($handle);
> ?>
>
/Daniel
--
Contact:
email: daniel@malarhojden.nu | UIN: 635335
Fortune:
Ban the bomb. Save the world for conventional warfare.