Re: count files
| From: | Rob Curts | Date: | Tue, 18 Jul 2000 14:57:23 +0000 |
| Subject: | Re: count files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7079@lists.php.net to get a copy of this message | ||
on 7/18/00 11:43 AM, sarahana at sarahana@scournepal.com wrote:
> I know that you can count the number of files in a directory through
> ASP, but I was wondering if its possible through PHP too cause I
> couldn't find such function in the manual. How do you do store all the
> filenames of a dir in an array so that you can loop and see properties
> and things like that?
very simple
<?
$dh = opendir("/path/to/directory"); // or c:\path\to\directory on windows
while ($f = readdir($dh))
$Files[count($Files)] = $f;
closedir($dh);
?>
hope that helps
Cheers,
Rob