Re: filecount
| From: | Gonzalo Vera | Date: | Thu, 07 Sep 2000 15:21:42 +0000 |
| Subject: | Re: filecount | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2507@lists.php.net to get a copy of this message | ||
Budgee:
How about this (untested as is, but tested in other form):
$handle=opendir('.');
while ($file = readdir($handle)) {
$count++;
}
closedir($handle);
Yow would probably want to substract 2 as surely this would count "."
and ".." as files.
Gonzalo.
> Hi Guys
> Any ideas how I would use php to count the number of files in a
> directory.
> I am writing a navigation script for our intranet
> (reserved1.glenwoodhighschool.co.za) and I need to count the
> number of files, so I know when I am on the last one, I mustn't
> display a "next" link.
> Any ideas.
> Thanks
> Warwick Chapman (1999)
> Assistant IT Manager
> Glenwood High School, Durban, South Africa
> 031 2055241
> 083 7797094
> www.glenwoodhighschool.co.za