Re: Count number of files containing certain string
| From: | Geoff Hankerson | Date: | Tue, 06 Aug 2002 19:38:47 +0000 |
| Subject: | Re: Count number of files containing certain string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111424@lists.php.net to get a copy of this message | ||
- Loop through all files in the directory
- Use a Regex expression to match a file name on "slides"
- If there is a match add the filename to an array
- after loop terminates just count the number of items in the array
There's an idea anyways. My php chops aren't up to snuff to whip up the code
in a jippy though
> I'm trying to piece together readdir() with some other code that will
> let me count the number of files in a directory that match a defined
> string. For example, how many files in "/dir" contain the string
> "slides"?
>
> I need the resulting number to use in a Javascript slideshow...