On Wed, 8 Jan 2003, Jeff Lewis wrote: > 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.
foreach() would work for you ... foreach( $dirs as $dirName => $indexName ){ $indexPath = "${dirName}/${indexName}"; $fh = fopen( $indexPath, "r" ); // ... fclose( $fh ); // I'm just guessing; do whatever you want in this loop } hth, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php