Posted by Krustov on 07/23/06 15:01
<comp.lang.php>
<Krustov>
<Sun, 23 Jul 2006 15:54:51 +0100>
<MPG.1f2d9e111c17bae989c86@news.newsreader.com>
> <?php
>
> $dirname="demo";
> $dh=opendir($dirname);
> while ($dave=readdir($dh))
> {
> print "$dave <br>";
> }
> closedir ($dh);
>
> ?>
>
I missed the bit where you said count .
<?php
$cnt=0;
$dirname="demo";
$dh = opendir($dirname);
while ($dave=readdir($dh))
{
print "$dave <br>";
$cnt=$cnt+1;
}
closedir ($dh);
print $cnt-2;
?>
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
Make a shorter url
www.vhit.co.uk
Navigation:
[Reply to this message]
|