Looping through directories?
| From: | Jeff Lewis | Date: | Wed, 08 Jan 2003 15:41:22 +0000 |
| Subject: | Looping through directories? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-130770@lists.php.net to get a copy of this message | ||
Currently I have a script that reads an index file and from that index file it then loops through
all files in that directory based on the index.
Instead of one directory now I have several and I want to loop through each directory and go to each
directory's index file. Since there is no pattern for the name if the indexes, I assume I need
to create an array holding the directory name and the associated index file name like so $dirs =
array("Sports" => "spindex.xml", "Business News" =>
"business.xml") etc
Now, I need help with the loop to whip through each directory. Would I do a foreach on the array I
just created? Any help would be greatly appreciated. I need to be able to access both the directory
name and index name.
Jeff