Yep, of course you need to specify the filenames in the script or generate them on the fly according to the algorithm you base it on... It appears to me that you want the list generated on the fly and based on existing files in a folder?
If so, then you need to investigate how to walk a directory folder, right? I'm sure there are scripts out there to do this.
$gInc = array("file1.inc", "file2.inc", "file3.inc");
In the code above, you would replace your algorithm function (lets call it FillIncludeFileList):
function FillIncludeFileList($baseDir) {
// walk directory tree and generate an array of filenames
// this part is up to you to decide
return($arrayOfIncludeFilenames);
}
$gInc = FillIncludeFileList("/mySite/folderwheretheincfilesreside");
Again, everything discussed so far is a general solution to the problem to give you an idea of how to approach it. For specifics about how to generate a directory tree, go http://us3.php.net/dir and look at msh at onliners dot dk post.
Hope this helps!