Oh, I get it now. I do this all the time but differently than you are doing it. Also use "code" tags when pasting code into a message. Keeps the format right.
First of all it looks like in your code you *want* to grab a list of files and exclude certain ones. It looks as if you "wish" to exclude "index.php" and all other "*.php" files. If that is the case, the partial answer is to change your subscripts from 1 and 4 to 0 and 3 (the first element of the array is actually 0).
When fixed this will still not exclude the "." and ".." because the "||" symbol means "or" not "through". And the 4th element (*.php) will not expand and match all PHP files, but instead would look for a single PHP file named literally '*.php'. If you'll also notice '..' *was* excluded from your list because exclude[1] is the 2nd element.
I assume that what you *really* want to do is ignore all files in your array right? I usually use the PHP grep function for this.
I'll copy/paste it into a PHP file and straighten it out for you...
[ January 09, 2003: Message edited by: void main ]